[apache] how to block a query string
Hello
I'm trying to block any incoming hits to this string:
[07/Aug/2016:00:56:14 +0300] "GET /?r=3
[07/Aug/2016:00:56:54 +0300] "POST /?r=3
there are other characters after 3 so i'll have to use a wildcard string.
based on a few hours of google search, i've found out that i can use an if directive, something like this:
<If "%{QUERY_STRING} =~ /?=r3*/">
Require all denied
</If>
but i think it's not written properly because if i add that to the virtualhost and restart, it crashes httpd:
AH00526: Syntax error on line 5 of /etc/apache2/sites-enabled/second.conf:
Cannot parse condition clause: Failed to compile regular expression
Action 'restart' failed.
also, i've seen that there is a way to use .htaccess with
RewriteCond %{REQUEST_URI}
RewriteRule
but i just can't understand how to write it so it uses a wildcard
if anyone can help, will be appreciated ;-)
thank you!
|