I've been reading a few tutorials online and searched a couple of other questions here but I cant seem to grasp the re-writing of dynamic URLS using the HTACCESS file.
I have URLs like:
products.php?cat=2
products.php?cat=3
products.php?cat=4
I would like them to just say products/2 for example
equipment.php?cat=2&subCat=1
equipment.php?cat=2&subCat=2
equipment.php?cat=2&subCat=3
I would like these to say equipment/2/1 for example
product.php?id=3010-Z89CH24
I would like these to say product/3010-Z89CH24 for example
but so far just trying to change the products.php pages I have this:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^*******\.com [NC]
RewriteRule (.*) http://www.*******.com/$1 [L,R=301]
Options +FollowSymLinks
RewriteRule ^products/'^([1-9][0-9]{0,2})'$ http://www.*******.com/products.php?cat=/$2 [L]
# REMOVE PHP EXTENSIONS
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L,QSA]
the thing is I dont think the end part "/$2" is correct and im unsure of the rest of it too :/
Either way its not working for me and I am stuck and struggling to understand it :(
can someone help me please?