Forum Moderators: phranque
I have a problem with Apache 2.0 handling of error documents. In my .htaccess, a PHP-script is set as error document:
ErrorDocument 404 /error404.php
Now, when data is posted to a non existing page, the error script is called but $_REQUEST and $_POST are empty. Is there a way to configure Apache 2.0 to pass the posted data to the error script?
With Apache, 1.3 all is working as expected, i.e. $_POST is filled.
Thanks
Kalle
Welcome to WebmasterWorld!
You might want to check the release notes and see if there were any 'security fixes' related to POSTed data. It is not good to allow POSTs to non-existent files, or to allow POSTs to be externally redirected, so they may have 'fixed' something related to this.
A work-around might be to use mod_rewrite's RewriteCond directive to check for a POST method to a non-existent file, and if so, rewrite the URL to your script, bypassing the ErrorDocument directive. This *may* preserve the POSTed information.
Jim
thank's for your hints. I have looked through the Apache documentation but could not find anything on posts to error documents. Unfortunately, my provider has disabled mod_rewrite, so I cannot use this method.
Under Apache 1.3 I had used the redirects via ERRORDOCUMENT to pass request to a CMS as 'virtual pages'. Now it seems, I have to look for another mechanism, but still have no idea. A simple but less elegant way that I wanted to avoid would be to put empty dummy pages into the correct path to prevent triggering of the error document.
Kalle