• Nice solution. I did this task years ago in PHP, and had to spoof a few HTTP headers, so I used this PEAR package to pass along the POST data. A lot more work than your simple one.


  • “For example, if I’m a malevolent webmaster, I already have the user’s data, so at this point displaying the dialog box is useless.”

    Well, a Web user may trust even a “malevolent webmaster” and their site, but not trust the site redirecting the POST data to, so the dialog box makes sense, IMO.

  • Does that PEAR package also pop-up a dialog box? And do you have an working example? For me, this issue is quite current.

    And yes, I agree with “the user might not trust my site redirecting his data to another”, but if I really want to, his data will get to the new site, one way or the other 🙂

  • Nice one. I had no idea POST requests could be forwarded with just a simple header. It reminds me of an issue with Apache where you POST data to http://example.org/location, and Apache issues a 301 redirect to http://example.org/location/ (notice the final slash). Because it’s a 301 response, it drops all POST data. I’ve scratched my head a couple of time because of this.

    By the way, it seems the RFC specifies the same behaviour for both 301 and 307 responses with POST requests, but Firefox only shows the confirmation dialog with 307 responses.

  • Pingback: Redirect GET requests to improve SEO rating | Tudor Barbu's professional blog()

Advertisment ad adsense adlogger