Mod_rewrite - a really easy one

Associate
Joined
19 Jun 2003
Posts
1,680
Location
West Yorks, UK
Hi all,
I've got a site with some heavy re-writing on it. For example, turning
Code:
/index.php?category=electrical&product=Stereo&id=143
into
Code:
/electrical/stereo/143/

However, it's been pointed out to me that someone entering
Code:
/electrical/stereo/143/index.php
will get a 404. Hence, i've setup a rewrite rule of:

Code:
RewriteRule ^index.php$ / [L,R=301,QSA,NC]

But, this doesn't take into account what happens when someone enters:
www.domainname.com/index.php (should go to www.domainname.com/)

Can i tweak the above mod_rewrite rule to make it redirect the homepage too?

Cheers,
Matt
 
It's for some SEO thing. I don't know myself, but the client i'm doing it for has been (well) advised that it needs to be done.

Matt
 
Back
Top Bottom