[wp-hackers] weird permalink issue

Steve Taylor steve at sltaylor.co.uk
Wed Mar 30 16:52:05 UTC 2011


Thanks Otto, you're the man. I've just removed redirect_canonical
function from that hook when I detect a URL corresponding to one of my
dynamic pages. All seems good now :)

Steve

On 30 March 2011 17:06, Otto <otto at ottodestruct.com> wrote:
> On Wed, Mar 30, 2011 at 8:12 AM, Steve Taylor <steve at sltaylor.co.uk> wrote:
>> The system I've built
>> intercepts that 404 and serves up a dynamic template.
>
> How does it do that?
>
> If you're hooking into the 404.php template or something, then you're
> basically doing it last, which is the wrong way to do it. The
> redirect_canonical function which is hooked into template_redirect
> will run first, probably going around your 404 logic and serving up
> the redirect before your code runs.
>
> Instead, hook your URL detection code into template_redirect with a
> higher priority, so as to run before any of the other template stuff
> takes effect. Then you can do your output and exit; before any of the
> normal template stuff runs.
>
> -Otto
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list