lets say i have the following GET variables available:
state
city
bedrooms
bathrooms
type
price
now i want them to come out like this:
mysite.com/state/city/#-bedrooms/#-bathrooms/type/price
however, i want this to work so that if one of these variables are not there, it will still work
i.e.:
mysite.com/state/city/#-bedrooms
or:
mysite.com/state/#-bedrooms/price
how do i do this?
It is much easier to do right in your code:
You can use whatever logic you want to process the request URI:
You can make parts of a regex optional using the
?
quantifier.This will however rewrite to empty variables if a subpattern is not matched.
So maybe you should rather define a list of RewriteRules with varying specificness: