How to set coming soon page in Magento by using IP address?

magento How to set coming soon page in Magento by using IP address?Recently I was doing my first Magento project and had to set coming soon page but the problem was if I set that so there will be problem for me and my client to see the progress so I came across the following code

Close Me

<?php
if ($_SERVER['REMOTE_ADDR']!==’1.2.3.4′) {
header(“Location: /comingsoonpage.html”);
exit;
}

but It didn’t work for me  so I came up with my code and its working perfectly for me and I hope it will work you as well

Close Me

if (($_SERVER['REMOTE_ADDR'] != ‘xxx.xxx.xxx.xx’) && ($_SERVER['REMOTE_ADDR'] != ‘yyy.yyy.yyy.yyy’))
{
require ”comingsoonpage.html’;
die();
}

1. In xxx.xxx.xxx.xx you can put your IP address and in yyy.yyy.yyy.yyy you can put your client IP.

2. In require ‘comingsoonpage.html’;  it points  name of my Coming Soon page so replace your page name with with its extension like ‘comingsoonpage.html but make sure it will be uploaded in your root directory.

Now Copy this code after adding IP and page name and paste it into your root index.php file after the first <?php  tag.

So just you and your client will be able to to see the website and the whole world will see the Coming Soon Page.

 

Source : http://shadabdurrani.com/how-to-set-coming-soon-page-in-magento-by-using-ip-address/

share save 171 16 How to set coming soon page in Magento by using IP address?

Comments

Tags: , , ,

One Response to “How to set coming soon page in Magento by using IP address?”

  1. Mikk October 30, 2012 at 11:51 am #

    Perfect, thank you!

Leave a Reply