I have spent some time learning how to do rewrites and have had success with it but cannot seem to get past this. I have a site that will have a url like http://www.domain.com/bystate.php?s=Massachusetts that I want to change to http://www.domain.com/Massachusetts, I did this with the following rule.
RewriteRule ^([a-zA-Z-/]+)$ bystate.php?s=$1
Now the probles is once in that page the user chooses a city and needs to be directed to http://www.domain.com/Massachusetts/west-newburyport
I have been trying to get this to work but it seems to stop at the first rul because it meets the conditions. I tried putting the second rule on top of the first and it didnt work. I also tried adding in a word ‘directory’ to try and get this to work, again nothing.
What am I doing wrong? Heres where I am.
RewriteRule ^([a-zA-Z-/]+)$ bystate.php?s=$1
RewriteRule ^([a-zA-Z-/]+)/([a-zA-Z-/]+)$ bycity.php?s=$1&c=$2
should work just fine?!