OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [users@httpd] restrict Location URL with special string


On Wed, Jun 13, 2018 at 2:27 PM MOKRANI Rachid <rachid.mokrani@xxxxxxxx> 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@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx