How to Disable ModSecurity for WordPress and DirectAdmin Domains using .htaccess

Follow the below guide to disable ModSecurity for your WordPress or DirectAdmin domain.

 

ModSecurity is typically enabled at the server level and applied to all domains on the shared hosting server. In some circumstances, particular rules might cause an application to break the site, and you might want to disable ModSecurity for that domain in the site's .htaccess  file.

As long as AllowOverride is permitted, you can place the following directives in .htaccess.

To disable ModSecurity :

<IfModule mod_security.c>
   SecRuleEngine Off
   SecRequestBodyAccess Off
</IfModule>

To disable an individual ModSec rule, use the following within the .htaccess

<IfModule mod_security.c>
  SecRuleRemoveById 1234567
</IfModule>
  • ModSecurity, WordPress, DirectAdmin, .htaccess, waf
  • 16 Users Found This Useful
Was this answer helpful?

Related Articles

How to install WordPress

How to install WordPressThis tutorial will show you how to install WordPress.For this tutorial,...

How to update your WordPress installation

How to update your WordPress installationThis tutorial assumes you've already logged in to...

How to write a comment in WordPress

How to write a comment in WordPressThis tutorial assumes you've already logged in to...

How to manage plugins in WordPress

How to manage plugins in WordPressThis tutorial assumes you've already logged in to...

How to manage pages in WordPress

How to manage pages in WordPressThis tutorial assumes you've already logged in to WordPress,...