Is it possible to put a magento site under an maintenance flag so that visitors will get a message that the site is under construction? I can't find this setting in the admin area.
Another solution will also be welcome.
Any help would be appreciated.
Thank you.
$ php bin/magento deploy:mode:set production Enabled production mode. Congrats! Now your store is running in production mode.
–admin-firstname-> Admin user's first name (required). –admin-lastname-> Admin user's last name (required). Note: If you are editing an existing user then only the first name, last name, and password can be edited.
I use this often. http://inchoo.net/ecommerce/magento/maintenance-mode-in-magento/
The important part is:
Open: index.php in root and above line 57 add (remembering to edit the ‘allowed’ array to contain the IP’s you want to be able to access the site);
$ip = $_SERVER['REMOTE_ADDR']; $allowed = array('1.1.1.1','2.2.2.2'); // these are the IP's that are allowed to view the site.
then change the line
if (file_exists($maintenanceFile)) {
to
if (file_exists($maintenanceFile) && !in_array($ip, $allowed)) {
To enable maintenance mode in Magento, just create empty maintenance.flag file in the root of your Magento store.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With