Helpful Information
 
 
Category: Apache Development
How do I make Apache not sending http 404-error

Hello.

The problem is MSIEE. When an error 404 (file not found) appers it shows its own internal page, omitting my error-message-script-page with lots of useful information for the users...

Is there a way telling Apache NOT to send the 404 (or other errors) to the client browser?

And can I control WHEN Apache should send the error-message?

The reason is: I have a lot of database generated pages on my server with adresses like http://www.server.net/GENERATED_PAGE/

The directory GENERATED_PAGE/ does not exist but is generated as a reply if the directory exist whitin the database but not as a directory on the server. Since it is not on the disc, an error 404 is generated.

I have made a error404.php-script comparing the adress whith the database. If the adress is found in the database, a page is generated. If not a error-message is generated.

Any suggestions?

Have you tried this?

http://httpd.apache.org/docs/mod/core.html#errordocument

My situation is similar to the first post. I've gotten the .htaccess file formatted properly yet now I get a 404 with an additional comment at the bottom that reads,

"Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. "

At first I thought the script that the 404 was supposed to go to was messed up but it wasn't. I then tried have the 404 page be an HTML page on another server but I still got the same error. Please help, thanks!

>> if the directory exist whitin the database but not as a directory on the server

It's the problem with your script that failed to check for directory existence correctly, then your script's execution stops and Apache takes over and send the 404 to browser. It's definitely your scripting problem.

>> Is there a way telling Apache NOT to send the 404 (or other errors) to the client browser?

Yes, but not recommended. You can put "-FileInfo" (without quotes) to http://www.server.net/.htaccess or in the directory block of your docroot, just don't put AllowOverride All or remove FileInfo from it.

>> My situation is similar to the first post

The answer to your question is similar as above. Additionally, you think your .htaccess file is properly formatted and your script is functioning but don't assume that's really the case.
Anyway, not enough info, please repost.










privacy (GDPR)