Thread Starter
sueme
(@sueme)
More info:
My existing .htaccess reads as follows:
# 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 a Google search, and it looks as though I may be able to add the following to the .htaccess:
Options +FollowSymLinks
RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)index.html$ http://www.yoursite.com/$1 [R=301,L]
However, I’m not fully sure how to do this and don’t want to screw things up.
Where exactly do I add the second bit of code to the first bit?
Can anyone tell me please?
Thread Starter
sueme
(@sueme)
OK Sorted.
Putting the new code under the existing code doesn’t appear to work, but putting the new code at the top does work.
Presumably it diverts index.html to index.php first, then activates the rest of the code.
The full code that works is:
RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)index.html$ http://mysite.com/$1 [R=301,L]
# 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
Thanks a lot for posting this. I was having the same problem and this did the trick.