All,
I am trying to setup an httpd server with multiple tomcat backends using mod_jk.
Currently, my setup looks kinda like this (only relevant parts):
<VirtualHost *:80>
DocumentRoot /docroot
ServerName
www.example.com
<Location /server-status
SetHandler server-status
</Location>
JkMount /app1/* backend1
JkMount /app2/* backend2
JkMount ...
</VirtualHost>
Now, I would like to setup a RewriteRule, which accoplishes the following task:
Rewrite all requests to /app1/ which are not matched by:
- /error/* (a static directory on apache)
- any JkMount (because there will probably be lots of JkMounts)
- any Handler (Apache Status, JK Status, ldap Status ... etc)
Is there a RewriteCond I am missing? I am trying to avoid a whole lot of REQUEST_URI RewriteCond's to accomplish this task. I already tried using mod_jk notes [1], but unfortunately they are not matched by %{ENV: ...}. Also, that wouldn't solve the problem with all those Handlers.
The only "Solution" I came up with was:
ErrorDocument 404
http://www.example.com/app1/
If apache is unable to serve the file, the request gets redirected to /app1/.
Is there a way to accomplish this using mod_rewrite and a "clearer" approach?
Regards,
Falco