You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Brian Owens <c-...@wcom.com> on 2002/02/27 22:44:39 UTC

Custom 404 Page

How do I set an ErrorDocument-like directive in Tomcat?  I have a custom 404 page setup in my Apache httpd.conf file, but when users enter a URL for a file not on my website they get the standard Apache-Tomcat 404 page.  For example, instead of going to /index.html (which is a valid file), I type /ind (which is not a valid file).  I don't think this is the same as the welcome file since I think that only refers to no filename being supplied.  In my case an invalid filename is supplied.  I'm running Apache 1.3.20 and Tomcat 4.0.2.

Thanks,
Brian



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: Custom 404 Page

Posted by Ricky Leung <ri...@booksense.com>.
assuming you have tomcat4 and you integrated with apache correctly and
apache send the request to tomcat because it matched the context path that
you specified, you can edit your webapp's web.xml and add the following.

    <error-page>
        <error-code>404</error-code>
        <location>/error/er404.jsp</location>
    </error-page>

but you will need to put it in the correct place, look at the dtd for where
to place it under.

-----Original Message-----
From: Brian Owens [mailto:c-brian.owens@wcom.com]
Sent: Wednesday, February 27, 2002 4:45 PM
To: tomcat-user@jakarta.apache.org
Subject: Custom 404 Page


How do I set an ErrorDocument-like directive in Tomcat?  I have a custom 404
page setup in my Apache httpd.conf file, but when users enter a URL for a
file not on my website they get the standard Apache-Tomcat 404 page.  For
example, instead of going to /index.html (which is a valid file), I type
/ind (which is not a valid file).  I don't think this is the same as the
welcome file since I think that only refers to no filename being supplied.
In my case an invalid filename is supplied.  I'm running Apache 1.3.20 and
Tomcat 4.0.2.

Thanks,
Brian



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>