httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: [users@httpd] Handling 404 errors
Date Wed, 26 Aug 2009 12:36:53 GMT
Richard Peacock wrote:

> *From:* Andrew Hole [mailto:andremailinglist@gmail.com]
> *Sent:* 26 August 2009 12:24
> *To:* users@httpd.apache.org
> *Subject:* [users@httpd] Handling 404 errors

Richard, when replying, can you quote normally, and not make
your reply look like some malformed signature to the original
post?  I had no idea this was a reply until I hit "reply"
in my mailer.

> What I want to know is if there are any option on Apache to handle 404 
> status code without retry the request. When file not found, some logic 
> will handle the 404 and return the file located on other folder.

ErrorDocument.  That can be a script, or might even be handled
within httpd.conf with mod_rewrite.

> ErrorDocument 404 /errordocs/404error.php

Yes, that's an option.

> <html><META http-equiv=’refresh’ 
> content=’1;URL=http://www.example.com/core/$_SERVER["REQUEST_URI"]’></html>

But that is not.  It's very, very evil, and damages end-users.
Your PHP (if that is your choice of scripting language) needs
to return the document you want to send.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message