httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Canavan <rainer.cana...@sevenval.com>
Subject Re: [users@httpd] restrict Location URL with special string
Date Wed, 13 Jun 2018 13:03:59 GMT
On Wed, Jun 13, 2018 at 2:27 PM MOKRANI Rachid <rachid.mokrani@ifpen.fr> wrote:

> I have URL like below (with ? and =)
> http://myserver/?s=about
>
> What’s the correct syntax to allow only some IP.
> <Location "/\?s\=about">
> Require ip 127.0.0.1
> </Location>

<location> only matches the path part of the URL, not the query string
(i.e. the part after the ?).

There's an example for matching QUERY_STRING in
https://httpd.apache.org/docs/2.4/en/mod/core.html#if

<If "%{QUERY_STRING} =~ /s=about/">
Require ip 127.0.0.1
</if>

may work, but I haven't tested it.


rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message