title: How to disable a specific mod_security rule in a specific directory?
body: <p>I want to disable this rule:</p>
  
  <pre><code>[file "/usr/share/modsecurity-crs/activated_rules/modsecurity_crs_41_sql_injection_attacks.conf"] [line "159"] [id "981173"] [rev "2"] [msg "Restricted SQL Character Anomaly Detection Alert - Total # of special characters exceeded"] [data "Matched Data: - found within ARGS:customize_changeset_uuid: a507417f-75f3-434e-ac8c-90b21b3b164d"] [ver "OWASP_CRS/2.2.9"] [maturity "9"] [accuracy "8"] [tag "OWASP_CRS/WEB_ATTACK/SQL_INJECTION"]
  </code></pre>
  
  <p>For the directory</p>
  
  <pre><code>/var/www/romanpastu/wp-admin
  </code></pre>
  
  <p>Where should the exception go? In my .htaccess? or the vhost file?</p>
  
  <p>Cause nothing seems to be working.</p>
  
  <p>I'm using <strong><code>apache2</code></strong></p>
  
  <p>I've tried adding the following in my <strong><code>virtualhost</code></strong> file. However, its still not working</p>
  
  <pre><code>&lt;LocationMatch "/wp-admin/update.php"&gt;
      &lt;IfModule security2_module&gt;
          SecRuleRemoveById 981173
      &lt;/IfModule&gt;
  &lt;/LocationMatch&gt;
  &lt;LocationMatch "/wp-admin/customize.php"&gt;
      &lt;IfModule security2_module&gt;
          SecRuleRemoveById 981173
      &lt;/IfModule&gt;
  &lt;/LocationMatch&gt;
  </code></pre>