I’m trying to figure out how to rewrite URLs while dropping the original parameter (whether it’s a number or text); basically exactly what WP does with it’s clean permalinks
Does a database lookup table exist that matches the post ID# to the permalink string as set in the post editor?
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
)This is human explanation without (almost without) any tech details. Hope its undestandable for everyone who didn’t work with rewrite_rules
No, for the most part.
WordPress stores its rewrite rules in the database. These are pattern-based rules for mapping URLs onto query parameters, and are determined by the permalink structure you’ve chosen (e.g.
%post_name%
) and any additional structures plugins have provided.For single items, WordPress extracts either
%post_id%
or%post_name%
(slug) from the URL and fetches that post from the posts table.