I am trying to figure out which hooks I can tie into in order to read the incoming URL prior to the query actually being run. A quick look tells me maybe
posts_selection would be good choices but would hate to miss out on something obviously better for my needs.
template_redirect sounded promising but seems to be called after content is selected so I do not think that is going to work.
I thought the rewrite code might help, but the likes of
generate_rewrite_rules do not seem to allow for arbitrary code to be executed... it seems to all be geared toward redirecting to existing content.
My goal is to write redirection code that I need to not be tied to an existing piece of content. I have found several plugins that do similar things, but all seem to require that a post or page be added to the system for the redirect to be attached to.
For instance, I want
/foo/bar to redirect to
/baz, but I don't want to have to create a page
foo or a sub-page of