views:

23

answers:

1

I have several rewrite rules in my .htaccess file that all work fine and I want to add a specific case to turn

sinaesthesia.co.uk/category/psoriasis

into

sinaesthesia.co.uk/category.php5?category=psoriasis

So I tried:

RewriteRule ^(.)category/(.)$ /$1category.php5?category=$2 [L]

which doesn't work. I've tried it without capturing the stuff before 'category' because category.php5 is at the root anyway, so it ought to work without that, have tried:

RewriteRule ^category/([a-z]+?)$ /category.php5?category=$1 [L]

with and without capturing the stuff before category, and nothing works - in fact, I generally get a 500 error! Here is the rest of the file:

RewriteEngine On

#remember to change this to aromaclear
RewriteCond %{HTTP_HOST} !^sinaesthesia\.co.uk$ [NC]
RewriteRule ^(.*)$ http://sinaesthesia.co.uk/$1 [R=301,L]

#Translate default page to root
RewriteCond %{THE_REQUEST} ^GET\ .*/index\.(php5|html)\ HTTP
RewriteRule ^(.*)index\.(php5|html)$ /$1 [R=301,L]

#translate any .html ending into .php5
RewriteRule ^(.*)\.html$ /$1\.php5  

#change / for ?
RewriteRule ^(.*)\.html/(.*)$ /$1\.html?$2

#strip .html from search res page
RewriteRule ^(.*)search/(.*)$ /$1search_results\.html/search=$2

#translate product details link from search res page
RewriteRule ^products/(.*)/(.*)/(.*)$ /product_details.php5?category=$1&title=$2&id=$3 [L]

#Translate products/psorisis/chamomile-skin-cream-P[x] to productview.php5?id=1
RewriteRule ^products/.*-P([0-9]+) /productview.php5?id=$1 [L]
A: 

Ah: because I have a document called category.php5 and I'm trying to use category/psoriasis, the server tries to resolve that as category.php5/psoriasis, which fails. Fixed it now!