- You have a set of url patterns and matches (wp generate a number of url patters to satisfy user agents).
- 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 inoptions
table by option namerewrite_rules
) - once it found… its parsed to query or better to say – matched_rule
- 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.
- 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
- 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
Related Posts:
- corrupted URLs – can’t leave starting page
- My wordpress site must be being affected by outside sources [duplicate]
- remove “index.php” from permalinks
- where is permalink info stored in database?
- Passing and retrieving query vars in wordpress
- How to remove dates from existing permalinks?
- Getting the Site URL Including the Front Base
- Including category-base in a post permalink results in 404
- WordPress thinks my custom route is a 404
- Date based URLs for custom posts and pagination
- How to custom change author base without $this->front?
- How to prevent the default home rewrite to a static page
- “.#[random-char-string]” being inserted at end of URLs
- URL Rewrite + Page + Custom Post Type = Unusual Redirect
- Pretty Permalinks
- Remove parent slug for child pages
- How to remove the index.php in the url?
- Remove subfolders from URL
- How can I Rewrite a ‘page’ URL based on query string parameters?
- custom naming of search permalink /search/
- Rewrite user profile URL to be human friendly
- Using WP rather than .htaccess to redirect pages/posts
- Rewrite URL Parameter And Force ‘Pretty’ Permalink
- rewrite_rule for custom post type doesn’t affect get_permalink
- Add ‘articles’ prefix before blog posts url without affecting pagination
- custom permalink/shortlink with base62 encoded post ID
- Incorrect 404 for pages when using permalink, a static front page, and posts page
- add new permalink structure from dynamic page
- WordPress not respecting template hierarchy (fetches index.php instead of single.php or page.php)
- How to improve WordPress security by hiding non public facing files?
- Call to a member function add_rule() on a non-object
- Custom taxonomy rewrite using tax name instead of rewrite slug
- Change author slug and functionality
- Why does chrome keep downloading a file instead of running the site?
- How can I add a page’s ID to its permalink using WP_Rewrite?
- Why is add_rewrite_endpoint incompatible with /%category%/%postname%/ permalink structure?
- Re-write specific custom post type category URL to go to another page
- Is it possible to keep all special letters for foreign languages in slug as in title?
- Change blog segment of URL
- add_rewrite_rule not working for me
- Using WP Rewrite, but just not “getting it”
- How to redirect to correct pages after permalink structure change
- Share same Slug for a Custom Post Type and 2 Taxonomies
- Rewrite CPT permalinks and include WPML language
- Redirect a Blogger Page URL to wordpress
- Custom permalink leads to index page
- How to remove /year/month from uploaded medias?
- Permalinks 404 error with HTTPS host
- IIS 7 Rewrite with parent categories
- How to rewrite a URL to another rewritten URL without changing the address?
- Passing the JQuery string to Worldpress URL
- Format HTTP links
- wordpress how to replace url /bar with foo/bar for custom post type
- Change directory url to be same as page permalink?
- How Do I get the author’s page id?
- Can WP give a value a post ID?
- Permalinks on Windows IIS not working and web.config breaks site – does wordpress not support windows server now, if so how?
- Order custom post type posts by custom field with pretty URL
- Show category name in the post URL only for specific categories
- Adding URL prefix for foreign language support
- 404 permalink errors on Pages only
- Exclude single page from permalink rule
- help to remove last trailing slash using add_rewrite_rule
- How are WordPress Page URLs affected by permalink settings?
- Change permalink to attachment
- Problems with permalinks (.htaccess not working)
- WordPress permalink from the database?
- WP-e-commerce (getshopped) – Annoying permalink issue [closed]
- Subdomains pointing to a permalink URL
- Changing permalinks back to default ( ?p=123 )
- IIS7.5 URL rewrite pboblem on index page
- Can I change the URL structure for a CPT only?
- How to set add_query_arg properly for home page?
- Create different permalinks for same post
- Multiple Taxonomy Items for Separate URLs
- MySQL-inserted custom taxonomy term lead to 404, flush rewrites doesn’t help
- Permalink not changing according to post type
- Website URL Permalinks
- WP permalink working, but why content doesn’t display
- Flushing rewrite rules enables to see an article, but I didnt change anything
- Redirect page to homepage, keeping URL
- How can I put WordPress in a directory but keep just the home page at the domain root?
- Updates all internal links on permalink update
- how to have same rewrite rules for 2 different post type?
- append current user-id to all internal permalinks
- rebuilding/ rewriting a url to make it SEO friendly
- What permastrusture tags are generated out of the box right after creating custom post types and taxonomies?
- Change all pages permalinks instead of hierarchical to have id of the page
- where is the media permalink info stored in database?
- How to rewrite a folder in WordPress?
- Rewrite single template permalink?
- Category-dependent custom permalink
- Folder Name and Category Name WordPress
- Editing the variables in a custom URL
- How to change pagination base from slash to query form?
- How to shorten the Permalink after WP>WP blog import?
- Single product link in woocomerce
- URL issues with WordPress
- Add additional URL variations for a Post
- How to make my custom permalink pull up the correct post