Mod rewrite and POST request
am 14.01.2008 10:19:43 von pieter.thoma
Hi,
I'm having the following rewrite rules:
RewriteRule ^post/login/$ post_processing.php?page=login
RewriteRule ^post/login$ /www/post/login/ [R]
If I request http://server/post/login it gets rewritten to
http://server/post/login/ but by then the POST request has become a
GET request.
I was wondering if this could be done without loosing the http POST
information?
Cheers
Re: Mod rewrite and POST request
am 14.01.2008 10:47:57 von phantom
wrote in message
news:baaeb094-15c1-4443-9097-a7ae0c8be4cb@s13g2000prd.google groups.com...
> Hi,
>
> I'm having the following rewrite rules:
>
> RewriteRule ^post/login/$ post_processing.php?page=login
> RewriteRule ^post/login$ /www/post/login/ [R]
>
> If I request http://server/post/login it gets rewritten to
> http://server/post/login/ but by then the POST request has become a
> GET request.
>
> I was wondering if this could be done without loosing the http POST
> information?
>
The second rule will force apache to respond with a 302 redirect, this will
tell the browser to change POST to GET (there is no way to redirect a POST
as a POST).
Why don't you just POST to the correct location in the first place?