Quote:
Originally Posted by leek
Something like this should do the trick:
Code:
RewriteEngine on
RewriteBase /
RewriteRule ^index\.(htm|html|php) http://www.yourdomain.com/ [R=301,L]
Of course, you'll need mod_rewrite enabled.
|
Quote:
Originally Posted by Doctor Feelgood
# redirects index.php to main url
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://www.yoursite.com/$1 [R=301,L]
|
Doctor Feelgood's will work but it slightly more taxing on the RegEx engine and tries to do work on *all* requests that have index.php in them, which can interfere with other mod_rewrite rules.
Mine works for index.html, index.htm, and index.php only and shouldn't interfere with other rules.