[wp-hackers] Bug or feature: Wordpress default rewrite rules cannot be overridden?
burobjorn at gmail.com
Sun Dec 6 14:04:59 UTC 2009
Thank you very much for your quick reply!.
I'm not quite there yet. Since using this gives me a 404 instead of the
page it should redirect to. I presume my rule does not match correctly
when using permalinks? Or am I missing something else?
This is the rule I use:
$docs_rule3 = array(
To match this:
or without permalinks
Both should redirect to the page. In this case with the name
Any help much appreciated!
Austin Matzko wrote:
> On Sun, Dec 6, 2009 at 6:58 AM, Bjorn Wijers <burobjorn at gmail.com> wrote:
>> However when this-is-a-random == an-existing-post-name it does not work
>> instead it redirects to the single post template. BUT only when
>> permalinks are switched on! If permalinks are off it still works.
> I believe what you're seeing is a feature called "canonical redirect,"
> which attempts to guess the correct destination for non-matching URLs.
>> Basically what I want is
>> First check my rules for blog posts and use these if they match
>> otherwise continue with the default rules/behaviour, which it does for
>> all strings not similar to an existing postname.
> You should be able to disable canonical redirect like so:
> remove_action('template_redirect', 'redirect_canonical');
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
met vriendelijke groet,
* b u r o b j o r n .nl *
digitaal vakmanschap | digital craftsmanship
3551 EM Utrecht
phone: +31 6 49 74 78 70
More information about the wp-hackers