• I have wordpress installed in a directory (/fld/) but I am running it from the root.

    My problem is that plugins and core wordpress functions are all inserting the directory /fld/ into the page urls – so for example recent posts widgets and the default wordpress menu are taking people to the wrong url.
    I would expect them to go to https://www.site/page/ but they are all going to https://www.site/fld/page. I have duplicate content issues because both versions of the page are viewable and indexable. What I want is for the /fld/ directory to be invisible to the viewer.

    My first question is – should this be happening, is this the default wordpress behaviour or have I done something wrong? (Second question is what have I done wrong!)

    My Settings
    1. Admin/settings/general: both the wodpress and site address end with /fld/

    2. Index.php require lines say the following;
    In /fld/ = require(‘./wp-blog-header.php’);
    In the root = require(‘./fld/wp-blog-header.php’);

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

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

    # END WordPress

Viewing 10 replies - 1 through 10 (of 10 total)
  • As far as I can see, you’re not doing anything wrong per se. This is simply the way in which WordPress works when you assign it to it’s own directory. If that’s not appropriate for you, you might ant to look at putting everything back the way it was initially and then physically moving WordPress to the root of the domain using the instructions outlined in Moving_WordPress.

    Thread Starter geez1

    (@geez1)

    That’s surprising. I really want to keep the files in their own folder rather than in the root if at all possible (its a site loads of people have had a go at over the years and there are literally thousands of files in the root which no one really understands).

    Is there any way round this problem so I can keep the files tucked away but change the default behaviour? I am using thesis so is there a function I could add to rewrite the urls created or even edit a core wp file?

    As Thesis is a commercial theme & we do not support commercial products here, you’d need to contact the theme’s vendors to see if there’s anything that they can suggest. Frankly, I doubt that there’s anything you can do within the theme.

    I think the best place to look for a possible solution to this is on the wp-hackers mailing list.

    Thread Starter geez1

    (@geez1)

    OK. One last thing to verify.

    For my settings, 1. Admin/settings/general: both the wordpress and site address end with /fld/. From reading the documentation I thought that one of these should be the root without the /fld/ which is why I thought I had done something wrong.

    Ah! I didn’t spot this earlier! The site url should be https://www.example,com whilst the WordPress url should be https://www.example.com/fld

    Thread Starter geez1

    (@geez1)

    I went through the instructions per the wordpress codex last night. When I changed the site url (and copied the htaccess and index.php from /fld/ to the root and made the change in the root index.php) the site loaded but without the css and plugins.

    All the files in the head section lost their /fld/ from the url. As the css and plugin files are still physically located in the /fld/ directory I assumed the urls in the head should still reference it.

    Which makes me think something else I have not spotted is not set up right or has been overwritten. Trouble is I am not sure where to look.

    I can only suggest that you through each step of Giving WordPress Its Own Directory again – very carefully. It’s always worked for me.

    Thread Starter geez1

    (@geez1)

    I have done this on other sites without issue and tried it several times on this domain with the same odd result.

    On this particular domain something is not set up per the default state. It should not work at all at the moment given the site url is set as https://www.site/fld/ but the site still launches correctly when you navigate to https://www.site. The obvious place to look is the htaccess files but they are not doing anything unusual.

    Anyone else got any ideas where I can look?

    You might want to check the hosts’ management page for that domain and remove any redirects etc that might be going on at the server level.

    Thread Starter geez1

    (@geez1)

    Still can’t fix this and there are no server level redirects. Anyone with big brains out there who can help pinpoint the issue?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Problem running wordpress from a directory’ is closed to new replies.