If have the following possible urls:
http://stackoverflow.com/categories/
http://stackoverflow.com/categories/category-type
http://stackoverflow.com/categories/category-type/category
http://stackoverflow.com/categories/category-type/category/sub-category
which I want to rewrite to
http://stackoverflow.com/categories/
http://stackoverflow.com/categories/?category-type=category-type
http://stackoverflow.com/categories/?category-type=category-type&category=category
http://stackoverflow.com/categories/?category-type=category-type&category=category&sub-category=sub-category
And here are my rewrite rules:
RewriteRule ^categories/([^/]*)/([^/]*)/([^/]+)(/)?$ /categories/?category-type=$1&category=$2&sub-category=$3 [NC,L]
RewriteRule ^categories/([^/]*)/([^/]+)(/)?$ /categories/?category-category=$1&category-=$2 [NC,L]
RewriteRule ^categories/([^?][^/]*)(/)?$ /categories/?category-type=$1 [NC,L]
The last rule is causing a 500 Internal Server Error. What is causing this?