I have a site where articles being submitted from worldwide and I record the location of them as Country -> State -> City, for that I am generating URLs like:
site/location/countryname/statename/cityname
I have a single php file which can take care of coming request and gets values in query string, now the problem is how to write mod_rewrite so it can have URL like above?
PS: It should not pass empty values if someone deletes the statename or countryname, means URL can be:
site/location/countryname
site/location/countryname/statename
site/location/countryname/statename/cityname
But can not be:
site/location//statename/cityname
site/location/countryname//cityname
In above urls if countryname is deleted then statename shouldnt be treated as countryname. Reading file name is location.php
Thanks,
Ok I have got a way to do that:
This single rule can take care, instead of three rules.