WordPress RewriteRule works on permalinks but not homepage

I have the standard wordpress rewrite rules on my site:

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

The site used to be in a subdirectory (mysite.com/1/), and is now in root, and I want to make sure that any requests for the subdirectory are redirected to root. The rules above do this for pages with permalinks (I assume because of the RewriteBase), e.g. mysite.com/1/contact is redirected to mysite.com/contact, but not for the homepage, so mysite.com/1/ is NOT redirected to mysite.com.

Read More

Can anyone provide a solution to redirect requests for the homepage in the subdirectory to root?

Related posts

Leave a Reply

1 comment