Hostgator Tips : Temporarily disable ModSecurity

If you’re hosted on Hostgator or any other host that use Modsecurity to protect their web server, you might notice some problems especially if you try to post something that has forbidden words / string in it (a good example is my previous post about Hostgator SSH Access). It seems the Hostgator modsecurity filter doesn’t allow some words in my previous post, so you’ll get HTTP 406 / Not Acceptable message (if you look at the http status header manually)

So what’s the best solution without compromising your system security ? .. you can add the below lines into .htaccess to disable modsecurity when you try to post something to your blog :

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

The above lines means : If modsecurity is found, it’ll disable the filtering function. If modsecurity not found it’ll do no harm to your server

And what’s next ? if you’re able to post to your blog successfully, you can remove the above lines from your .htaccess file or you can simply add # character before each line

Leave a comment

Comments

  1. Akash Shell May 14, 2013 at 11:38 PM

    Thanks. That was quite useful. Now not getting 406 anymore.

  2. Ilandrona Jul 5, 2007 at 1:00 PM

    Oh, i was so irritated with disability to disable filtering function! Thank you for your tips, you are my saviour)

    —————————
    Software Reviews and Downloads

To reduce spam, if you're posting comment for the first time, it'll be moderated first. And if they aren't spam, subsequent comments will appear automatically. Also you may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>