• [ Moderator note: moved to Fixing WordPress. ]

    So this is my current domain setup: domain.com/dir1/dir2/
    Domain.com (Drupal) – works fine
    /dir1/ (WordPress1) – works fine
    /dir2/ (WordPress2) – doesn’t seem to obey rewrite base

    I have a .htaccess file in the root of dir2 telling it the rewrite base of /dir1/dir2/.

    But when I try to access relative paths, for example /wp-content/uploads/image.jpg, it resolves to domain.com/wp-content/uploads/image.jpg instead of domain.com/dir1/dir2/wp-content/uploads/image.jpg.

    The theme developer used <?=$root;=?> which seems to resolve correctly to the theme directory.

    Any suggestions to help set the root directory correctly with htaccess or can I not nest WordPress installation directories?

    • This topic was modified 7 years, 2 months ago by bradysewall.
    • This topic was modified 7 years, 2 months ago by Jan Dembowski.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Your issue is using relative paths. That’s normally a bad way to do things, and you’ve just seen the biggest reason of why.

    Trying to access a relative path with a leading / will always resove it to the root domain, and not a folder somewhere. That’s why you’re getting that. I could be wrong, but as far as I’m aware setting a rewrite base in your .htaccess file doesn’t help with this.

    The best solution is dont use relative paths. It removes any potential issues like this, and is normally easier to do because there’s no ambiguty about anything.

    Thread Starter bradysewall

    (@bradysewall)

    @catacaustic thanks for reply. That’s what I was afraid of. The vendor that developed the website used relative paths. I’ll have to do a find and replace on the website files and database to resolve the issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Issues with subdirectory / rewritebase’ is closed to new replies.