tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Apache mod_jk SetEnvIf negative look ahead not working
Date Mon, 22 Jun 2009 08:58:30 GMT
as2 wrote:
> Hi,
> I am trying to add a rule .. 

Try this :

# First, all URLs that start with "/app/" and end in either .jsp, .htm
# or .html are forwarded to Tomcat
<LocationMatch "^/app/.+\.(jsp|html?)$">
   SetHandler jakarta-servlet

# But, we don't want that if it's inside of "/app/dir/"
<LocationMatch "^/app/dir/">
   SetHandler none

# Except if it is inside of a "/jsp/" subdir of "/app/dir",
# then we do want it anyway
<LocationMatch "^/app/dir/.*/jsp/">
   SetHandler jakarta-servlet

You may need to modify that a bit, according to what you want exactly 
(which is not so clear in your original question).

But the base is :
- <Location> and <LocationMatch> are applied one after the other,  in 
the order in which they appear in the configuration file.
(See : )
- "SetHandler jakarta-servlet" makes it so that all applicable URLs are 
  proxied to Tomcat
- "SetHandler none" cancels the effect of a previous "SetHandler 
jakarta-servlet" and returns to the default Apache handling.
(See : )

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message