You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Brian Akins <ba...@web.turner.com> on 2003/04/11 19:26:30 UTC

[users@httpd] ErrorDocument just doesn't work (Apache2)

I am running 2.0.45, with the following in the httpd.conf:

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<Directory "/opt/apache/htdocs/">
    Options Indexes FollowSymLinks Includes 
    AllowOverride None
</Directory>

ErrorDocument 404 /404.html


/opt/apache/htdocs/404.html exists and direct requests for it are fine. 
However, requests for host/bad_url always return the default apache 404
error. All that is in the logs is
 "File does not exist: /opt/apache/htdocs/bad_url".  


If I do something bad on purpose like setting: 

ErrorDocument 404 /garbage.html

and /opt/apache/htdocs/garbage.html does not exists, request for
host/bad_url get the exact same response as before, and the following is
logged:

File does not exist: /opt/apache/htdocs/bad_url
File does not exist: /opt/apache/htdocs/garbage.html

This should produce an error with "additionally...."


No matter what I do, I cannot get ErrorDocument to work.  I'm I missing
something?

--Brian

---------------------------------------------------------------------
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


Re: [users@httpd] ErrorDocument just doesn't work (Apache2)

Posted by Brian Akins <ba...@web.turner.com>.
On Fri, 11 Apr 2003 20:07:21 -0400
"Jeff Cohen" <li...@gej-it.com> wrote:

> What you are doing here is making a loop to the error referral, when
> you want to assign html page 404.html to error 404 you do as you did,

Yet not even this works.  When I set ErrorDocument 404 /404.html, I do
not get 404.html for 404 errors, I get the default page "404 Not Found
Page."  Setting "ErrorDocument 403 /404.html" does nothing either.  The
find DOC_ROOT/404.html does exist, it just never gets served for any
error.  What's interesting if I set "ErrorDocument 404
http://domain.com/404.html" that works, but it is a redirect and not a
404.  I have tried with the httpd-std.conf and just added this line and
added some debug stuff to the http code (to ap_die in
modulce/http/http_request.c) like this:

 
    if (custom_response && custom_response[0] != '"') {
..
}
        else if (custom_response[0] == '/') {
            const char *error_notes;
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                          "begins with slash: %s",
                          custom_response);
          
And this always prints whenever I have "ErrorDocument 404 /404.html" and
I request a non existant file, but the "end user" (telnet in my case)
always gets the default 404 error.





---------------------------------------------------------------------
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


RE: [users@httpd] ErrorDocument just doesn't work (Apache2)

Posted by Jeff Cohen <li...@gej-it.com>.
What you are doing here is making a loop to the error referral, when you
want to assign html page 404.html to error 404 you do as you did, but when
the server gets a 403 (or any other) and cannot find the error file or no
file has assigned to it, it won't give 404.html page, it will give the
browser default page which is what you get.
For instance if you want to get the 404.html page coming up when you do 403
error, you MUST assign error code 403 to that page, otherwise it will give
your browser's default page, so you must do: ErrorDocument 403 /404.html to
get the result you are looking for.

All the best,
Jeff Cohen

> -----Original Message-----
> From: Brian Akins [mailto:bakins@web.turner.com]
> Sent: Friday, April 11, 2003 1:27 PM
> To: users@httpd.apache.org
> Subject: [users@httpd] ErrorDocument just doesn't work (Apache2)
> 
> I am running 2.0.45, with the following in the httpd.conf:
> 
> <Directory />
>     Options FollowSymLinks
>     AllowOverride None
> </Directory>
> 
> <Directory "/opt/apache/htdocs/">
>     Options Indexes FollowSymLinks Includes
>     AllowOverride None
> </Directory>
> 
> ErrorDocument 404 /404.html
> 
> 
> /opt/apache/htdocs/404.html exists and direct requests for it are fine.
> However, requests for host/bad_url always return the default apache 404
> error. All that is in the logs is
>  "File does not exist: /opt/apache/htdocs/bad_url".
> 
> 
> If I do something bad on purpose like setting:
> 
> ErrorDocument 404 /garbage.html
> 
> and /opt/apache/htdocs/garbage.html does not exists, request for
> host/bad_url get the exact same response as before, and the following is
> logged:
> 
> File does not exist: /opt/apache/htdocs/bad_url
> File does not exist: /opt/apache/htdocs/garbage.html
> 
> This should produce an error with "additionally...."
> 
> 
> No matter what I do, I cannot get ErrorDocument to work.  I'm I missing
> something?
> 
> --Brian
> 
> ---------------------------------------------------------------------
> 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


---------------------------------------------------------------------
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