Questions tagged [locationmatch]

An Apache directive to apply the enclosed directives only to URLs matched by a regular expression. Similar to Location, but with regexp support.

29 questions
15
votes
2 answers

How can LocationMatch and ProxyPassMatch be Combined?

I am setting up an Apache 2.4.6 server on an internal machine for testing purposes. One of the things that Apache server is supposed to do is act as a reverse-proxy for another server found on localhost:3030. The server on localhost:3030 expects one…
O. R. Mapper
  • 20,083
  • 9
  • 69
  • 114
7
votes
1 answer

HTAccess LocationMatch Server Error

I'm trying to use this .htaccess to change the RewriteBase if the location is local or live server. Options +FollowSymlinks RewriteEngine on #RewriteBase /beta/admin/ RewriteCond %{REQUEST_URI}…
James
  • 5,137
  • 5
  • 40
  • 80
7
votes
1 answer

Apache LocationMatch Regex

My Problem I need to have Apache HTTP Server (v2.4.10) proxy requests to Tomcat for dynamic applications, which not only do not match the path in Tomcat, but are also have similar paths to one another. For…
Crollster
  • 2,751
  • 2
  • 23
  • 34
5
votes
2 answers

Apache, LocationMatch: match query string

How can I match a query string using LocationMatch with apache? // ... ... won't work unfortunately.
watain
  • 4,838
  • 4
  • 34
  • 35
4
votes
1 answer

Apache 2.2.25 LocationMatch failing regex

I am trying to upgrade Apache from 2.2.22 to 2.2.25 but I am running in to trouble with the LocationMatch Directive not using the regular expressions. I have 2 example location match definitions below, I have the first one working, but if I try to…
dba1701a
  • 61
  • 5
3
votes
0 answers

LocationMatch Regex Behavior

I am trying to set a bunch of url-based rules in Apache with LocationMatch and the regex seems to behave in a way I do not understand. I tried looking up the documentation but it isnt very clear to me WRT to my issue... nor are the other…
agent provocateur
  • 824
  • 3
  • 19
  • 39
3
votes
1 answer

LocationMatch rules with Apache

I need to fix (with or without regex) so you can access "/admin.php?+" but not "/SUBSITE/admin.php?+" on a site. Anyone has a good idea of how to fix that?
J Rog
  • 45
  • 7
2
votes
1 answer

apache LocationMatch and Basic Auth

Is there any way to get matched substring from LocationMatch and use it as part of configuration? I have several similar sites that uses apache Basic auth and want to check against "sitename".passwd files.. in code I mean this but…
Ficik
  • 149
  • 1
  • 9
2
votes
0 answers

Apache Substitute with LocationMatch-Hit not replaced

I have a Problem with dynamic content-replacements. Apache-Substitude don't replace variables matched by LocationMatch or request-vars like %{REQUEST_URI}. my plan is to proxy a page and replace the base-href-content. href="/" ->…
sha
  • 21
  • 1
2
votes
0 answers

apache 2.4 LocationMatch not catching

I need to set htaccess directives in a virtual host for everything that isn't either / or /example/{anything}. I've looked at everything I can find an it seems like apache is doing something weird with regex I can't figure out why it's not working.…
mcoatney
  • 143
  • 9
2
votes
1 answer

Apache LocationMatch matching urls starting with...

I'm using apache to redirect AJAX request to server backend in my AJAX app. Everything that starts with /service/ should go to service backend: ProxyPass http://backend:8080/service Keepalive=On Header set…
9ilsdx 9rvj 0lo
  • 7,955
  • 10
  • 38
  • 77
2
votes
1 answer

Apache LocationMatch regex with subdomain

I'm trying to use LocationMatch to match an URL in a website's second-level subdomain but not in it's third-level subdomain. This is because I want to password protect some URLs at that level. eg. level2.domain.com/some/url should match but not…
Andrei
  • 1,606
  • 4
  • 19
  • 31
2
votes
1 answer

Apache location match wildcard URL

My VHOST currently looks like: DocumentRoot /data/sites/example_deploy ServerName deploy.example.co.uk Options +SymLinksIfOwnerMatch AllowOverride All …
HGSSO
  • 55
  • 1
  • 8
1
vote
0 answers

Apache order and regexes

I've trying this for a couple of days and maybe am I wrong in some way. I'm trying to change the header depending on the final url, but the first capture group is always the same, /folder, happens that Apache is just using the last rule as I seen on…
wiitohzjeh
  • 337
  • 1
  • 4
  • 15
1
vote
1 answer

Apache LocationMatch everything but root

I'm reading that actually matches the entire domain, not just the root location. I want to create a Location or LocationMatch block that matches everything but http://my.domain.com/ This means it will trigger if any characters follow…
jlewkovich
  • 2,725
  • 2
  • 35
  • 49
1
2