I have a php server and i want to rewrite incoming urls. Since incoming requests are post requests I also want posted data to be transferred at the new urls.
I have managed to redirect urls with the following rewrite rules:
RewriteRule ^test/(.*)$ http: //localhost/index.php?data=&1 [NC,L]
or
RewriteRule ^test/(.*)$ http: //localhost/index.php?data=&1 [NC,R=301]
I have also managed to preserve post data with the following rewrite rule:
RewriteRule ^test/(.*)$ http: //localhost/index.php?data=&1 [P]
The problem is that I can not both of them at the same time. What am I doing wrong? Is there a way to redirect url and keep post data?