Ajax 503 error

Ajax 503 error

Today I got a problem when working with client website that is hosted with dreamhost.com. There is an Ajax function that did not work as it should do. With the help of firebug I’m able to see that this Ajax is trying to POST data and somehow the server reject its request then return 503 error.

I spent a few hours checking my codes and trying some possibilities. It was a waste of  time, none of them provide solusion. So I try google. After a few minutes I got my search term “dreamhost ajax 503 error htaccess” show better search result. It lead me to askapache.com’s page that explain how to turn off mod_security. This mod_security is enabled in dreamhost servers and this is why the Ajax POST was always rejected.

Here is a quick fix. You will need to add the following lines in .htaccess file.

1
2
SecFilterEngine Off
SecFilterScanPOST Off

The first line is to disable the mod_security. The second line is to disable POST scan, but it might be not necessary as you have disable it with the first line.

I can’t believe I have spent so much time to figure this simple answer …

3 Responses to “Solution for PHP Ajax error 503 Service Temporarily Unavailable”

Leave a Reply