Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to do some url rewriting. I've picked this example right off the wordpress wiki here:


The wiki page says:

This example would match a requested URL like this: ...and interpret it to actually mean...

(I've simplified it to redirect to index.php?foo=bar ). However, I'm still getting a 404 error when I try to visit http://localhost/myblog/nutrition/milkshakes/strawberry/. What am I doing wrong?

share|improve this question
what is your actual, not simplified rewrite rule? you have to load a WordPress object- a page, a post, an archive, etc.. You can't just set arbitrary non-existent query vars. – Milo Nov 15 '13 at 2:23
@Milo My line for setting the url is exactly as i gave, index.php?foo=bar – Click Upvote Nov 15 '13 at 2:48
did you add the rule on the init action? have you flushed rewrite rules by visiting the permalinks settings page? – Milo Nov 15 '13 at 3:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.