homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

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)

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)

problem solved.

RewriteRule ^index.php$ http://example.com/? [R=301,L]


 8:43 am on May 14, 2011 (gmt 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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved