I have to do some redirects - index.html and index.php to /.
I could redirect www.domain.com/index.html and www.domain.com/index.php to www.domain.com with this line:
RewriteRule ^index\.(php|html?)$ http://www.mydomain.com/ [R=301,L]
However I still have problems with pages like these:
www.domain.com/directory/index.html- returns 200 OKwww.domain.com/directory/index.php- returns 300 multiple choices (don't know why)
Is it possible to redirect them to www.domain.com/directory/ and do it all with one rule one?
If this helps, here's what's in my .htaccess file now:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
## Redirecd index.html & php to /
RewriteRule ^index\.(php|html?)$ http://www...mydomain...com/ [R=301,L]
## 301 Redirect from non-www to www version
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
## Return 404 status code and display 404.html
ErrorDocument 404 /404.html
</IfModule>