I'm having a bit of trouble getting multiple rewrite rules to work as I planned for a recipe site I'm writing.
Basicially I have 2 absolute pages...
domain.com/category.php?id=chicken
domain.com/recipe.php?id=a-chicken-recipe
The respective friendly URL's I wish to use are along the lines of...
domain.com/chicken
domain.com/chicken/a-chicken-recipe/
Currently my rewrite code is as follows...
- Code: Select all
RewriteEngine on
###add trailing slashes to http requests###
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) http://%{HTTP_HOST}/$1/ [R=301,L]
RewriteRule ^(.*)/$ /category.php?id=$1
RewriteRule ^(.*)/(.*)/$ /recipe.php?id=$2
But I think what is happening here is the first rule is catching both instances?
Any help would be appreciated.
Thanks