Forum Moderators: phranque
I have the following URL:
example.com/data/123/
mod_rewrite actually serves up
example.com/path/to/file.php?id=123
(this is an internal redirect, so the normal http 200 OK code is returned with the original URL)
So far, your classic use of mod_rewrite to beautify URLs.
What I want to do now is to have a form that POSTs data to the rewritten URL; i.e. method="post" action="data/123/"
It seems that this is not possible with mod_rewrite..
when you POST to the rewritten URL, mod_rewrite serves up the content
from the underlying page, but the POST data is not received by that page, so in effect a POST request for URL 1 becomes a
GET request for URL 2.
Is there anyway for POST data to be passed on to a page that
is hidden behind a rewritten URL?
I hope the above is clear enough :)
- Hugo
You might want to use a server headers checker, such as Mozilla's "Live HTTP Headers" extension for Firefox, Mozilla and Seamonkey, to track the entire POST process and see if there's an unexpected redirect getting invoked by some other rewrite rules or mod_alias directives.
Jim