Disabling mod_security

If you discover a lot of errors, it’s most likely the result of something triggering a rule in mod_security. We use mod_security to block comment and referrer spam, but sometimes it get’s triggered by mistake. This can happen if something on your site (like a URL) matches a common pattern (like  ”-sex”).

one quick way to resolve this is to put the following in a .htaccess file in your root directory:

SecFilterEngine Off

This will disable mod_security for your domain.

Note: some times  we will need to disable mod_security for you in the main Apache configuration file and it might not work in your case.

 once you disable mod_security you are no longer protected from referrer and comment spam.

when mod_security is disabled you can troubleshoot this by looking through your logs to see what rules are being triggered. when you know what rules are being triggered you can selectively turn them off to get everything work again

for example let's say you find a URL on your site  creating the following error:

    The precondition on the request for the URL /path/abc.php evaluated to false

add the following to an .htaccess file:

SecFilterEngine On
SecFilterSelective "REQUEST_URI" "/path/abc.php" "allow,nolog"

Sometimes the 412 error can also occur when posting something to your site via a form, like when the content contains a specific word like “sex”.

In this case you would add the following to an .htaccess file:


SecFilterEngine On
SecFilterSelective "POST_PAYLOAD" "sex" "allow,nolog"
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Do you offer windows Shared Hosting?

If you do not see windows Shared Hosting in our plans you can still contact us.We want to cover...

Do you offer cpanel?

Yes, Depending on the hosting plan you order we might offer cpanel too. If we offer cpanel on a...

What if I am unhappy with my purchase?

We are more than happy to discuss any difficulties that you are having, if you feel after this...

What types of shared hosting are available?

Although many different types of shared hosting are available, UNIX/Linux and Windows hosting...

Is shared hosting right for my needs?

Because of the limited resources and economical price of a shared web hosting plan, it is often...