First off - HELP!
I have looked high and low, up and down and still can't get this working. What I am trying to do it get a rewrite rule that handles up to 4 directories. Here is what I am looking for
domain.com/city/state/category/subcategory/
This redirects to index.php?city=$1&state=$2&cat=$3&subcat=$4
But I won't always have 4, I want to be able to redirect to:
/city/state/
/city/state/cat/
or /city/state/cat/subcat/
Here is my .htacess
RewriteEngine on
RewriteRule ^([A-Z,a-z,0-9,\_]*)/([A-Z,a-z,0-9,\_]*)/([A-Z,a-z,0-9,\_]*)/([A-Z,a-z,0-9,\_]*) /location.php?city=$1&state=$2&category=$3&subcat=$4
It works so long as I have the right number of slashes
For instance city/state/// works
or city/state/cat/
Is there some way to make this work without the slashes and be able the handle the 3 items above, or better yet, all four
Thanks in advance