Case-insensitive Location
Asked Answered
K

3

7

I am using VisualSVN Server that installs an Apache server.

In the below example

    <Location /MyIISWebSite>
      ProxyPass https://my-domain.com:8443/MyIISWebSite
      ProxyPassReverse https://my-domain.com:8443/MyIISWebSite
    </Location> 

how do I make the

    <Location /MyIISWebSite >

to be case insensitive in order to match all combinations (like myiiswebsite, MYIISWEBSITE, ...) ?

Katlynkatmai answered 6/7, 2011 at 17:36 Comment(0)
D
7

Use LocationMatch with a case-insensitive regex modifier, like so:

<LocationMatch "(?i)/MyIISWebSite">
...
</LocationMatch>
Decosta answered 25/8, 2011 at 19:45 Comment(3)
I tried this, but is not working. Is there a mod I should have included for this to work?Katlynkatmai
Hm, works in a VirtualHost container. No additional mods necessary, that I'm aware of. Docs here: httpd.apache.org/docs/2.2/mod/core.html#locationmatchDecosta
How does the solution apply to a ProxyPass example? Could you provde a example?Thetic
P
3

I've been using:

<LocationMatch "/(?i:mywebsite)">
    Allow from all
    Satisfy Any
</LocationMatch>

and that works on apache 2.2

Pilgrim answered 24/10, 2012 at 19:6 Comment(2)
Worked for me on Apache/2.4.7 :DPhilomel
How does the solution apply to a ProxyPass example? Could you provde a example?Thetic
U
1

This is a pretty old question. Just posting a solution which can be helpful for others.

I use ProxyPassMatch which is equivalent to ProxyPass but allows usage of regular expressions.

Refer Apache HTTP Documentation

Example :

ProxyPassMatch (?i)/abc http://mydomain.com/handle-all-variants-of-abc

This will match all combinations : (abc, abC, aBc, Abc, ABc, aBC, AbC, ABC)

Unpriced answered 4/6, 2014 at 10:26 Comment(1)
How does the solution apply to ProxyPass? Could you provde a example?Thetic

© 2022 - 2024 — McMap. All rights reserved.