tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reynir Þór Hübner <rey...@hugsmidjan.is>
Subject Re: Letting apache handle 404s
Date Sun, 08 Aug 2004 20:03:37 GMT
hi,

Try editing and adding the folowing to your /tomcat/conf/web.xml :
     <error-page>
         <error-code>501</error-code>
         <location>/501.html</location>
     </error-page>
     <error-page>
         <error-code>404</error-code>
         <location>/404.html</location>
     </error-page>


What happenes is that this would be a global configuration for 
errorpages for all your webapplications (not just some hosts/contexts) 
because it's in the top-level web.xml. There for you dont need to 
configure this specially for all webapplictions you deploy.

You could of course configure this differently. You might even want to 
configure the errorpages to redirect the user to the corresponding 
errorpage in apache, or make apache use the same folder of errorpages as 
tomcat.

hope it helps
-reynir





Henrik Gammelmark wrote:
> 
>>> My primary httpd is Apache2 but i connect to Tomcat5 using the 
>>> mod-jk2 connector. The problem is, that it seems that tomcat handles 
>>> too much of apache's job. For instance if I enter a URL ending in 
>>> .jsp I see a tomcat 404 instead of an apache 404 - presumably because 
>>> apache naivly passes all .jsp requests on. But can I make tomcat 
>>> "politely" inform apache about the 404 and let apache take actions 
>>> instead?
>>
>>
>>
>> Tomcat can have customized error pages too.
> 
> 
> I know, but it would mean that for each domain hosted I would have to 
> change the settings two places every time a change would be made. I hope 
> it's possible...
> 
>>
>>> Strangly, if no "default" files, such as index.jsp og index.php is 
>>> present in the directory, tomcat - not apache - presents a folder 
>>> listing.
>>
>>
>>
>> This is an FAQ item:
>>
>> http://jakarta.apache.org/tomcat/faq/misc.html#listing
> 
> 
> Thank you
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message