With the following directive:
ErrorDocument 404 /index.php
The Apache web server internally redirects to a new location. Internally, the client (browser) will not change the URL in the address bar, because the redirect is not transmitted to the browser.
Since this is a redirect, the POST request turns into a GET request.
You can see this by looking at the following two $_SERVER
:
$_SERVER['REDIRECT_REQUEST_METHOD']
In short, you cannot use the ErrorDocument
directive to rewrite URLs for HTTP POST requests.
To do this, you need to use the mod_rewrite
module or create your own apache handler.
hakre source share