Mod security Block GET request to URI path
<p>I need to block the GET request for a certain URI path.
I'm using anomaly mode, but im using a straight block rule, I cannot get the rule to work properly</p>

<p>example <code>GET /secure/test/bla/bla/</code>
example <code>https://bla.bla.com/secure/test/bla/bla?www.test.com</code></p>

<pre><code>SecRule REQUEST_URI "@streq \/secure\/test\/bla\/bla\?.+" \
 "phase:1,id:92,t:none,t:urlDecode,t:lowercase,t:normalizePath,deny,status:403,msg:'403 Access Denied',chain"
SecRule REQUEST_METHOD "@streq post" "t:none,t:lowercase"
</code></pre>

<p>Can I write this with a reg expression like so ?</p>

<pre><code>SecRule REQUEST_URI "!@rx ^(:?\/secure\/test\/bla\/bla\?.+)$" \
 "phase:1,id:91,t:none,t:urlDecode,t:lowercase,t:normalizePath,deny,status:403,msg:'403 Access Denied',chain"
SecRule REQUEST_METHOD "@streq post" "t:none,t:lowercase"
</code></pre>

<p>These are not working and I cannot figure out why, do I need to write the regular expression in a different way?</p>

<p>In the secound rule do I need to add <code>"@rx</code>? whats the difference betweeen <code>"!@rx and @rx</code></p>