WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] WordPress and Site in Separate Folders

[Resolved] WordPress and Site in Separate Folders

  • I know this question has been asked a thousand times, and I feel like I’ve read and tried every one of the responses. I must be overlooking the one certain way to accomplish what seems like should be a simple task.

    I originally had installed WordPress in the root of my site prior to beginning real development. Then I read some more and decided it would be smart to locate the WordPress core files in a subdirectory of the root, which I named wp. I uninstalled and reinstalled using the subdirectory and then developed my site, having read that it is possible to do this and still have users access the site’s root without the subfolder being visible to them in the url.

    What I thought should work was this:

    1. In WordPress under Settings | General, specify the URL addresses I want to use.
    WordPress (where WordPress is installed): http://www.mysite.org/wp
    Site: http://www.mysite.org

    2. Copy the index.php file to the root folder and edit it so that it reads:
    */require(‘./wp/wp-blog-header.php’);

    3. The htaccess file in the root has this content (nothing more or less):

    # 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
    #

    I did not do anything with Permalinks since I’m not using them and they are still set as Default.

    Can someone please tell me what I’m doing wrong?

    As s short-term solution I have set both URL addresses in WordPress to be http://www.mysite.org/wp, no index.php in the root (lives in my wp folder only), and code in my htaccess in the root that redirects to the wp folder:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www.)?forestmoontheater.org$
    RewriteRule ^(/)?$ wp [L]

    While this works, I’d rather the wp folder not appear in the url so when users are on my site. Right now it shows as http://www.mysite.org/wp/….

Viewing 2 replies - 1 through 2 (of 2 total)
  • Correction:

    My htaccess file in #3 above was edited to look like this instead:

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

    I started fresh today and followed the instructions here precisely. This time it worked. I think my mistake was in modifying the htaccess file after copying it to the root, which was something I had read elsewhere but was not specified here. Just stick with the steps exactly as written.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] WordPress and Site in Separate Folders’ is closed to new replies.
Skip to toolbar