I'm working on a really odd site which has a couple of Magento installs next to a Wordpress install.

the folder structure looks like this:

/shop (magento)
/shop-world (magento)

I just installed Yoast on the Wordpress install and the first thing it did was edit the Wordpress .htaccess settings without creating a backup.

How can I edit this:

# 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]
# END WordPress

So that instead of routing all requests through index.php (which doesn't exist) the site routes all requests through wp/index.php? I tried adding wp/ on the necessary lines but its not working, and I'm getting an internal server error.

Disclaimer: I didn't make the site like this – but I do need to fix it without moving all the files.

1 Answer 1


Rather than change .htaccess, move the index.php up to root, open it, and change:

require( dirname( __FILE__ ) . '/wp-blog-header.php' );


require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );

In Settings, your WordPress address should be http://example.com/wp, and Site address should be http://example.com.

This process is outlined in the Codex page Giving WordPress Its Own Directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.