SEF re-writes
Posted: Thu Sep 29, 2011 9:51 am
I've been a member here before but have had to re-join as forgotten my username!
Anyway I've been pulling my hair out trying to get some sef rewrites to work in htaccess using regex. I've been all over the place trying to find some code that will work but all I've found is stuff that's well old or stuff that doesn't work correctly. This is the scenario. I'm developing a site and this is what I want to rewrite:
http://www.thesite.com/location/product.php?id=prodtype to this http://www.thesite.com/location/prodtype
The latest thing I've tried is this:
AddType x-mapp-php5 .php
RewriteEngine on
RewriteRule ^/([a-z])/([a-z])$ /$1.php?id=$2
But it just keeps coming up with page not found. Any help much appreciated or if anyone can point me to somehwere where there is a tutorial on sef rewriting with php that works that would be great. Please bare in mind I am using shared hosting so limited to doing this via htaccess.
Cheers
Anyway I've been pulling my hair out trying to get some sef rewrites to work in htaccess using regex. I've been all over the place trying to find some code that will work but all I've found is stuff that's well old or stuff that doesn't work correctly. This is the scenario. I'm developing a site and this is what I want to rewrite:
http://www.thesite.com/location/product.php?id=prodtype to this http://www.thesite.com/location/prodtype
The latest thing I've tried is this:
AddType x-mapp-php5 .php
RewriteEngine on
RewriteRule ^/([a-z])/([a-z])$ /$1.php?id=$2
But it just keeps coming up with page not found. Any help much appreciated or if anyone can point me to somehwere where there is a tutorial on sef rewriting with php that works that would be great. Please bare in mind I am using shared hosting so limited to doing this via htaccess.
Cheers