Firstly all those back-slashes must be forward-slashes. The \
is used to "escape" special characters, not for folder separation.
Rewriting products.php
to products
will not work if you have a products folder already. I'd suggest moving all the images to a different directory like /images/cameras/50d.jpg
. Then you can do this:
RewriteRule ^products products.php
With that you will need to parse the requested URL in PHP to find the variables. You could also use this:
RewriteRule ^products/([^/]+) products.php?cat=$1
RewriteRule ^products/([^/]+)/([^/]+) products.php?cat=$1&prod=$2
Now in your PHP script you automatically have the required variables via $_GET['cat']
and $_GET['prod']
.
EDIT: actually you're right, it is possible to have both, as long as all the images are limited to specific extensions. I think this will work:
RewriteRule ^products/(.+).jpg products/$1.jpg [L]
RewriteRule ^products/([^/]+) products.php?cat=$1
RewriteRule ^products/([^/]+)/([^/]+) products.php?cat=$1&prod=$2