WordPress Rewrite Rules
Trying to write a WordPress plugin that modifies the rewrite rules? I bet you have problems getting your rules to actually be used. There’s a simple explanation for it: WordPress doesn’t generate the rewrite rules on every page visit, they are cached. To refresh this cache you can use the
flush_rules() WordPress function (don’t do this in your plugin init function because your site might grind to a halt) or you can just simply visit the permalinks page (Settings->Permalinks) as this will flush the rules as well.
You can find more information about rewrite rules and how to extend them in the WordPress Codex.