I am trying and failing at the moment to rewrite my urls for seo friendliness. Can you point out where I might be going wrong?
I'm trying to rewrite this url:
http://www.chillisource.co.uk/product?&cat=Grocery&q=Daves%20Gourmet&page=1&prod=B0000DID5R&prodName=Daves_Insanity_Sauce
To this:
http://www.chillisource.co.uk/product/Grocery/Daves%20Gourmet/1/B0000DID5R/Daves_Insanity_Sauce
This is my .htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteRule ^product/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+) /product?&cat=$1&q=$2&page=$3&prod=$4&prodName=$5
The first part allows me to go without the .php in the filenane.
This currently gives me error 500 when I try and go to: http://www.chillisource.co.uk/product/Grocery/Daves%20Gourmet/1/B0000DID5R/Daves_Insanity_Sauce
I've read up on mod_rewrite but I'm a novice programmer and finding it hard going. I don't get how $1, $2, $3, $4, $5 which are the variables in my url get transfered to the other side, is ([a-zA-Z0-9]+) correct?
Thanks in advance.