[wp-hackers] Wp rewrite rule binding to admin-ajax.php

Dion Hulse (dd32) wordpress at dd32.id.au
Thu Mar 10 23:49:43 UTC 2011

WP_Rewrite is not a .htaccess type of thing.
Specifically, WP_Rewrite converts a Request into Query Vars.

IE. /2008/09/post/ is the same as index.php?year=2008&month=09&postname=post

It can't be used to rewrite to a admin-ajax, or non-index.php entry point.

The standard way of achieving this, is to set a custom query var, register
it through query_vars filter, and hook in on parse_request(or similar, some
use template_redirect, but thats after posts have been queried - i'm not
sure of the best one off the top of my head) and handle the ajax response


On 11 March 2011 09:48, Lox <lox.dev at knc.nc> wrote:

> 2011/3/11 John 3:16 Media <wp at john316media.com>
> > I had a problem with 404 errors after registering a custom posttype
> > and taxonomy, flushing rewrite rules didnt work for me either.
> > Howevver going to permalink options switching to default rules p=
> > saving, then switching back and saving worked for me.
> >
> Tried. It still sends me to the front page.
> --
> Lox
> lox.dev at knc.nc
> _______________________________________________
> 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