I'm seeing something unexpected, although I'm not sure whether it's a feature I can disable or whether it is something introduced by the custom theme I'm using that I need to track down.
If I enter a url for a non-existent page, e.g. mysite.com/london, before throwing a 404 it will search for a post with a title that starts with "london" and show that if it finds it, e.g. mysite.com/events/london-weekend-party.
(I have a number of different CPTs, but this redirect is CPT-agnostic, i.e. it doesn't seem to care which post type contains 'london' in the title. When I register the CPTs the only rewrite rule is for the slug, e.g.
'rewrite' => array('slug'=>'events'.)
I used the plug-in Debug This to look at the rewrite rules, but it hasn't helped because it appears to be showing the rule that matched after the rewrite happened, i.e. not that it matched against
mysite.com/london but against the post it found, i.e.
I only discovered the 'problem' because I was looking at how to intercept 404s before the 404 template is loaded to check the urls against a whitelist so that if I get a match for, say mysite.com/london, I can do something London-specific before a redirect. If anyone has any tips on where to get started with that, I'd be grateful to hear them. My first instinct was to $_GET hooked into wp but I'm not talking about
?name=value style parameters.