• thfump

    (@thfump)


    I tried posting this several days ago but didn’t get any responses — and I’m afraid it’s because I was far too wordy and confusing in the way I first tried to ask it. So I’m hoping I can try again. ??

    Essentially, I have WordPress installed in a subdirectory (at freeish.net/msp/), but WordPress is acting like it’s actually installed at the root level. So it wants to create permalinks like “http://freeish.net/sample-post/” rather than like “http://freeish.net/msp/sample-post/” — which is what I want it to do.

    The index.php file is indeed in the /msp/ folder, as it should be, and the .htaccess file contains the following rewrite code:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /msp/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /msp/index.php [L]
    </IfModule>
    # END WordPress

    Note: when WordPress creates this URL rewrite code for itself, it always creates it without “/msp/” in either of the locations where you’ll see it above. Without “/msp/” on either the RewriteBase or RewriteRule lines, however, all links on the site end in 404 errors. But if I manually add “/msp/” in these two places in the .htaccess file, then permalinks work okay — albeit at the root level (i.e., freeish.net/sample-post/).

    So here’s the question:
    How do I force WordPress to create permalinks in the subdirectory where WordPress is actually installed?

    Thanks very much in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi

    (@esmi)

    Is there also a WordPress index.php and .htaccess file in the root domain folder?

    Thread Starter thfump

    (@thfump)

    esmi, thanks very much for the reply. Sorry for getting back to it so late.

    There’s no index.php file in the root directory. But the .htaccess file I’ve been messing with IS located in the root. Should I move it to the /msp/ folder?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress acts like it's installed in root, when it's actually in a subdirectory’ is closed to new replies.