I have questions about the URL rewrite. Currently, I have the following rules setup in my .htaccess file.
- Code: Select all
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /brand\.php.*\ HTTP/
RewriteRule ^brand\.php$ http://www.computersox.com/brand/%1/ [R=301,L]
RewriteRule ^brand/([A-Za-z0-9-]+)$ http://www.computersox.com/brand/$1/ [R=301,L]
RewriteRule ^brand/([_0-9+a-z-A-Z]+)/$ brand.php?brand=$1&search=$1&allwords=on [L]
The first one is I want to transform parameterized URL to SEO Friendly URL. I know it is not working now.
e.g.
http://www.computersox.com/brand.php?brand=Sony&search=sony&allwords=on
TO
http://www.computersox.com/brand/Sony/
(All I need is the parameter for Brand)
The second one is to add the / at the end of URL
The third one is to rewrite SEO url to Parameterized URL.
Currently, the last 2 rules are working, but the first rule I don't know how to make it work.
Any helps will greatly appreciated.
Thank you very much for reading this post.
Andrew