Forum Moderators: phranque
No doubt this has been answered numerous times before -- so if you would just point me to the thread I'd really be greatful.
Have tried numerous things, including the code below, to no avail.
RewriteCond %{REQUEST_URL}!^/index\.php$
RewriteRule ^$ http://www.example.com/$1 [R=301,L]
Thanks!
Thanks so much for getting back to me. I've searched every place and can't seem to find the answser to this:
Due to hijackers I need to 301 www.mysite.com/index.php, www.mysite.com/index.htm and www.mysite.com/index.html to www.mysite.com/
Also is it possible to do a 301 for www.mysite.com.htm to www.mysite.com/
I REALLY appreciate any assistance on this.
As to my second question: Given that the code works so wonderfully, am I correct in assuming that the following will 301 www.example.com.htm to www.example.com/
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*com\.htm\ HTTP/
RewriteRule ^(.*)index\.html$ http://www.example.com/$1 [R=301,L]
Best,
Marls
As a result, it's not likely that these requests will ever reach your server, and so no code on your server can affect these requests.
I'd concentrate on finding the source(s) of these malformed domain requests and getting those links corrected.
Jim