Forum Moderators: phranque

Message Too Old, No Replies

redirecting index.php

redirecting index.php using mod_rewrite

         

stu_uk

1:19 pm on Jan 31, 2006 (gmt 0)

10+ Year Member



I'm sure this has been been asked before but couldnt find it.

I have a problem with people linking to www.mydomain.com/index.php, i want to use a rewrite rule to redirect it to www.mydomain.com

so my first thought was to do

RewriteRule ^index.php www.mydomain.com [r=301,nc]

this doesnt work presumably because my host is rewriting www.mydomain.com as www.mydomain.com/index.php and therefore apache enters an endless loop. Firefox tells me "redirection limit for this url has been exceeded... blah blah" or something to that effect.

I'm sure there is a simple soloution, any ideas?

jdMorgan

2:30 pm on Jan 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This problem was discussed yesterday in this thread [webmasterworld.com]. It's a fairly common problem that requires a somewhat 'tricky' solution.

Jim