[wp-hackers] Bug or feature: Wordpress default rewrite rules cannot be overridden?

Bjorn Wijers burobjorn at gmail.com
Sun Dec 6 12:58:37 UTC 2009


I'm tearing my hair out on this one:

I have a url like this:


or without permalinks


Which works and returns this-is-a-random-string to this-is-a-var query
variable in my this-is-page page template so I can process it further.

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 have checked the url rewrite rules, using both the more than awesome
Ask Apache rewrite rules viewer as well as var_dump the global
wp_rewrite object. I can see clearly that my rules are added on top of
the rules so they should be first to processed. This confirms the
behaviour when permalinks are switched off. However with permalinks
switched on Wordpress dodges the rules and heads straight to the single
post when it encounters a postname. Is this a bug or a feature? How can
I overrule this?

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.

Any help much appreciated!


met vriendelijke groet,
Bjorn Wijers

* b u r o b j o r n .nl *
digitaal vakmanschap | digital craftsmanship

Concordiastraat 68-126
3551 EM Utrecht
The Netherlands

phone: +31 6 49 74 78 70

More information about the wp-hackers mailing list