Extending rewrite rules
-
I am trying to extend the rewrite rules for a directory.
I am setting up 50 pages, 1 for each state. The default rewrite rules handle these pages.
EX: http://www.domain.com/directory/california
However, I want to extend URLs to also include one more level of detail – cities.
EX: http://www.domain.com/directory/california/san-diego
However, doing this returns a 404 because there is no page created for San Diego. I don’t want to create pages for San Diego. I essentially want this:
http://www.domain.com/directory/california/san-diego
rewrites to
http://www.domain.com/directory/california?city=san-diego
I will use template logic to then determine if a city is defined – if so, show all listings within the city. If no city is defined, show all the available cities for the current state.
- The topic ‘Extending rewrite rules’ is closed to new replies.