httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Falco Schwarz <>
Subject [users@httpd] RewriteCond if no handler matches
Date Wed, 18 Jun 2014 13:35:17 GMT

I am trying to setup an httpd server with multiple tomcat backends using
Currently, my setup looks kinda like this (only relevant parts):

<VirtualHost *:80>
    DocumentRoot /docroot

    <Location /server-status
        SetHandler server-status

    JkMount /app1/*   backend1
    JkMount /app2/*   backend2
    JkMount ...

Now, I would like to setup a RewriteRule, which accoplishes the following

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

If apache is unable to serve the file, the request gets redirected to
Is there a way to accomplish this using mod_rewrite and a "clearer"



View raw message