Do WordPress Permalinks Refer to a Lookup Table in the Database?

  1. You have a set of url patterns and matches (wp generate a number of url patters to satisfy user agents).
  2. once you request lets say domain.com/posts/2003/somestuff url, wp tring to find a pattern that match this url inside a rewrite_rules (array that stored in options table by option name rewrite_rules)
  3. once it found… its parsed to query or better to say – matched_rule
  4. matched rule basicly looks like dirty url (a url of wp site without turned on permalinks) , and matched_rule is a set of arguments that passed to WP_Query.
  5. Once WP_Query get arguments and return some data (posts/pages/etc…) all of this data (wp_query and results) passed to view (template), index.php/single.php/etc.php
  6. And here you got a page.

This is human explanation without (almost without) any tech details. Hope its undestandable for everyone who didn’t work with rewrite_rules