Home » Tutorials For Beginner » How to show maintenance mode page in magento (website under construction)

How to show maintenance mode page in magento (website under construction)

Sometime you want to put your store offline for some reasons, for example: changing site’s template, adding new Magento module, create a landing page. So, how can we show maintenance mode page in magento (website under construction) when our website is under maintenance but still allows access from specific IP addresses?

magento maintenance mode 1

There are many ways to put a Magento store to Maintenance mode but in this tutorial, we will be dealing with maintenance.flag – a quick and safe way to put your store to maintenance mode. If you want your Magento website to show in maintenance mode, you will have to do two things.

1. Create a file name maintenance.flag in your magento root directory. Contents under this file doesn’t matter, you can keep it empty.
2. Change the maintenance file (located in magento root -> errors -> default directory) to show proper message when user visits your website.

Well done, for now, even admin user can not access the site.

I still want to access my site to make changes, how to do that?

Step 1: In order to have access, we need to modify index.php file in Magento root folder and specify list of IPs that will allowed to access your site. Download and open original index.php file.

On line 47 put the following code:

In the $allowed = array(’69.65.23.100′,’2.2.2.2′);  you should specify list of IPs that will have access to your site.

Step 2: Search for the following code:

Replace it with

Look modified code you can see on the screenshot below.

how to magento site to maintenance mode 1

Now you can access your site with the ip defined in the file.

How to edit maintenance message

In order to edit content showing on maintenance page, open errors/default/503.phtml file, find the maintenance message and edit as you wish.

how to magento site to maintenance mode 2

Some funny maintenance mode pages for reference

funny magento maintenance mode page 1 funny magento maintenance mode page 2 funny magento maintenance mode page 3

 

About Brian Wilson

avatar
Brian is a freelance Magento developer with 5 years of experience with customizing Magento extensions, magento themes. He's interested in sharing Magento Tutorials to the community

2 comments

  1. avatar

    which ip address do i’ve t enter the public ip address

  2. avatar

    Can you help me to add checkbox in admin add customer page.I am alble to to it but when save customer I get error for setData()

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Scroll To Top