Sunday, December 25, 2011

PrestaShop TIPS - Issues when your PrestaShop 1.4x at maintenance mode

Back ground information
This tips is for PrestaShop owner who are facing page error when you access your PrestaShop store at its maintenance mode.

As PrestaShop owner, you know there is a function that you can set your PrestaShop to maintenance mode to prevent user from accessing your store. You can set your store to maintenance mode at back office admin page.

Log in to your back office
Click Preference tab
Set "Enable store" to "No"
You can also set the some IP address to allow access from specific IP address

The issue
When you set your store at maintenance mode, general visitors will get an page error and most browsers will redirect visitor to some other pages or even goes to search page. Your store"maintenance message" only appears a few seconds. Below is images showing how this happens.

This is not good to your site, because it will give visitors wrong message.

This screen transit is from my Firefox browser.

This screen transit image is from my IE

Causes of the issue
Why this will happen?
This is because PrestaShop send a "HTTP/1.1 503 temporarily overloaded" message to visitor's browser. Here is code from PrestaShop 1.4x

header('HTTP/1.1 503 temporarily overloaded');

Solution to the problem The solution to this issue is very easy.
what you need to do is to delete or comment out the following line by adding two "/" in front of the line.

//header('HTTP/1.1 503 temporarily overloaded');

Personally, I don't it is necessary and HTTP error to browser when the PrestaShop store under maintenance mode. It is not an HTTP at, it is normal maintenance mode.

No comments: