tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Holger Klein-Altstedde" <holger.klein_altste...@prioeins.de>
Subject AW: how to avoid the directory list without any index.html/jsp
Date Mon, 02 Sep 2002 10:05:41 GMT
You can force tomcat not to index your directories:
Edit your web.xml and change the listings parameter.

  <servlet>
    <servlet-name>default</servlet-name>
 
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-clas
s>
    <init-param>
      <param-name>debug</param-name>
      <param-value>0</param-value>
    </init-param>
    <init-param>
      <param-name>listings</param-name>
      <param-value>false</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>

Now tomcat will not show the dirs. 

You can configure some custom error pages like this:

<web-app>
  <error-page>
    <error-code>404</error-code>
    <location>/errorpages/401.jsp</location>
  </error-page>


A way to redirect on a special error code to your own errorpage.

Hope this helps.

Regs
Holger

> -----Ursprüngliche Nachricht-----
> Von: micheal lau [mailto:iam_micheal@hotmail.com] 
> Gesendet: Montag, 2. September 2002 11:57
> An: tomcat-user@jakarta.apache.org
> Betreff: how to avoid the directory list without any index.html/jsp
> 
> 
> hi all,
> i am using tomcat 4.0.4
> how to avoid the directory list without any index.html or 
> index.jsp by redirect to 403 forbidden error instead of any 
> welcome page
> 
> but how to config?
> thanks for any help
> micheal
> 
> 
> _________________________________________________________________
> Join the world’s largest e-mail service with MSN Hotmail. 
> http://www.hotmail.com
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
> 


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


Mime
View raw message