Hi everyone,
Firstly thank you for reading my post. I'm writing a plugin, which relies on mod_rewrites. After a lot of searching, I've finally managed to add my own rewrite rules to WordPress, and these are being followed - well sort of.
I know the rules are being followed, because an URL query variable is being set, and its value echoed out in the content successfully. This is being acheived by filtering the content for the requested URI using the_content filter.
The problem I am having is that my rule is set to redirect the page to for example:
my-page/random => my-page?var=random
Yet, even though the URI says I am on the my-page/random page, the content of the site homepage is displayed instead??
I've tried amending my rewrite to read:
my-page/random => index.php?pagename=my-page&var=random
But this doesn't work either. Can anyone give me any pointers please?
How can I get WordPress to render the correct page content?
Sorry if my post is a little vague, I'm not the best at explaining things.
Thanks in advance.
R.