1

I was writing a test HTML form locally, invoking a distant webpage in the action field. However I figured that though set as POST, the form would only send GET data. I moved it on the distant server, but it behaved the same way. Then I changed the absolute URL to a relative one and it worked.

Is it expected, or is there some server setting to change this behaviour ?

Here is an almost minimal form reproducing the issue :

<form action="http://example.com/foobar.php" method="post">
  <input type="text" name="blah">
  <input type="submit" value="Submit">
</form>

For testing purposes foobar.php could contain

<?php echo $_SERVER['REQUEST_METHOD']; ?>

Edit : There must be something wrong with my setup, since I can find loads of similar and supposedly working samples on the web (and actually this is what I am supposed to achieve at the end).

Skippy le Grand Gourou
  • 6,976
  • 4
  • 60
  • 76

1 Answers1

0

Got it, this is because POST data is discarded on 301 Permanent Redirect, and I was using a ServerAlias with RedirectMatch 301.

A solution could be to use 307 Temporary Redirect but I think I will just stick to the main ServerName.

Community
  • 1
  • 1
Skippy le Grand Gourou
  • 6,976
  • 4
  • 60
  • 76