Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have the following Location directives in my httpd.conf:

<Location /App1>
    SetHandler weblogic-handler
    WebLogicHost 1.2.3.4
    WeblogicPort 7003
</Location>

<Location /App2>
    SetHandler weblogic-handler
    WebLogicHost 1.2.3.4
    WeblogicPort 7004
</Location>

<Location /Dev>
    SetHandler weblogic-handler
    WebLogicHost 1.2.3.4
    WeblogicPort 7005
</Location>

Now I want any requests made to a path that is != /App1 or /App2 to have the same settings as the /Dev location.

something like

<LocationMatch "/^(?!App?).*\./*">
    SetHandler weblogic-handler
    WebLogicHost 1.2.3.4
    WeblogicPort 7005
</LocationMatch>

Would seem like a suitable solution, but it doesn't seem to work. Any ideas?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Here's the solution:

<LocationMatch "/*">
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !Dev
    RewriteCond %{REQUEST_URI} !App1
    RewriteCond %{REQUEST_URI} !App2

    RewriteRule ^(?!Dev)(?!App1)(?!App2)(.+) http://LINK-TO-DEV/ [L,R=301]
</LocationMatch>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.