I'm trying to do some url rewriting. I've picked this example right off the wordpress wiki here:
add_rewrite_rule('^nutrition/([^/]*)/([^/]*)/?','index.php?foo=bar','top');
The wiki page says:
This example would match a requested URL like this: example.com/nutrition/milkshakes/strawberry/ ...and interpret it to actually mean...
example.com/index.php?page_id=12&food=milkshake&variety=strawberry
(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?
index.php?foo=bar