Forum Moderators: phranque
from: www.mydomain.com/brand.php?brand=brandname
to: www.mydomain.com/brands/brandname.html
One of the things I tried:
rewriteEngine on
rewriteRule ^brands/(.*)\.html$ /brand.php?brand=$1 [T=application/x-httpd-cgi,L]
and that won't work, but this will:
rewriteEngine on
rewriteRule ^(.*)\.html$ /brand.php?brand=$1 [T=application/x-httpd-cgi,L]
I wrote a similar rule but "$1" accepted an integer rather than characters. Is that my problem? If so, why does the second code I wrote work?
Is this code located in httpd.conf or in .htaccess? If in .htaccess, where is it located, in your web root or in a subdirectory?
The code should work in .htaccess in web root, unless your getting a rewrite loop.
Check your server error log to see if there is any indication of a problem.
Jim
This also works for some strange reason:
RewriteRule brands/(.*)/$ /brand.php?brand=$1 [T=application/x-httpd-cgi,L]
outputting www.mydomain.com/brands/brandname/
I don't really need it, but its annoying me not knowing why everything works accept that one.