Forum Moderators: phranque
I use rewrites to disallow indexing of non-www. It works fine as follows.
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
I now want to rewrite http://www.example.com/fanpage/index.php to http://www.example.com/fanpage/
Please could someone point me in the right direction. I have crashed my server twice today and I've gone a little grayer ;)
Thanks for the help in advance.
PTD
[edited by: jdMorgan at 3:53 pm (utc) on Jan. 30, 2007]
[edit reason] example.com [/edit]
If so, does this [webmasterworld.com] help?
Jim
Nice it works for the home page. However it does not affect internal pages.
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.htm\ HTTP/
RewriteRule ^index\.htm$ http://www.example.com [R=301,L]
Do you know how to run this rule for all internal pages?
Thanks,
PTD
[edited by: Pass_the_Dutchie at 5:41 pm (utc) on Jan. 30, 2007]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.htm\ HTTP/
RewriteRule ^(([^/]*/)*)index\.htm$ http://www.example.com/$1 [R=301,L]
Jim