Apache & PHP: Headache with POST / GET · 10 December 2011, 02:43
Occasionally, you may have the misfortune of writing scripts wherein PHP seems to be able to retrieve GET values without issue, but POST values are lost in some netherworld.
Not to beat around the bush:
If you’re sending your POST data to a URL that represents a directory but does not include a trailing slash, Apache may silently 301-redirect the request to the same URL with the trailing slash.
Example: A POST to:
http://localhost/directory
…will be silently 301-redirected to:
http://localhost/directory/
Obviously that’ll lose your POST data.
The more you know!
— Neike Taika-Tessaro
Comment
| Categories: | bugisms, development, knowledge, server-side |
|---|---|
| Related: | JavaScript and CSS Block Encoding: Broken by design · 1 September 2010, 14:44Dear Google · 15 April 2010, 16:27mediawiki's Special: Recent Changes bug · 30 November 2009, 15:04Extending phpDocumentor with custom tags · 23 October 2009, 19:36PHP loose type comparison: Arrays · 18 September 2009, 13:30 |