I am having some trouble getting rewrite rules to work as I want in my a WordPress plugin.
I added a rewrite rule:
add_rewrite_rule('some_url','some_redirected_url', 'top');
The rule is written to .htaccess and the rule works as expected; when inspecting the $_SERVER variable I get the following:
$_SERVER['REDIRECT_URL']='some_redirected_url'
$_SERVER['REQUEST_URI']='some_url'
However, WordPress is parsing $_SERVER['REQUEST_URI'] for request arguments so the redirected request is not parsed.
In other words, if I go to http://myserver/some_url the request is not working, even if the redirect works. If I go directly to http://myserver/some_redirected_url everything works correctly.
How can I make WordPress parse the redirected URL?