Welcome to WebmasterWorld Guest from 54.196.217.43

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Old site was a Blog now we switched to a new CRM with clean URLS

but now I can't redirect the old files. Need help with a Rewrite Rule.

     
8:27 pm on May 11, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Aug 25, 2008
posts:88
votes: 0


Looking to rewrite ANY url with index.php in the begining to the homepage.

I tried this:

RewriteRule ^index.php(.*) http://www.example.com/ [R=301,L,QSA]


But it will not work. All it does it remove the index.php. How do i strip whatever is after index.php.
8:37 pm on May 11, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Aug 25, 2008
posts:88
votes: 0


problem solved.

RewriteRule ^index.php$ http://example.com/? [R=301,L]
8:43 am on May 14, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


You need to escape the literal period in the RegEx pattern.

Are you sure this rule doesn't create an infinite loop? Normally you need to test THE_REQUEST too.

Do you want this only in root? That's all it does so far.