Gaurav Agrawal Gaurav Agrawal - 3 months ago 18
Apache Configuration Question

How can I disable mod_security in .htaccess file?

How can we disable

mod_security
by using
.htaccess
file on Apache server?

I am using WordPress on my personal domain and posting a post which content has some code block and as per my hosting provider said
mod_security
gives an error and my IP has gone into firewall because of
mod_security
.

So I want to disable
mod_security
by using
.htaccess
file.

Answer

It is possible to do this, but most likely your host implemented mod_security for a reason. Be sure they approve of you disabling it for your own site.

That said, this should do it;

<IfModule mod_security.c>
  SecFilterEngine Off
  SecFilterScanPOST Off
</IfModule>