Enable or disable maintance mode - Magento 2

The Magento application have option to make site in maintance mode during maintaining, upgrading, or reconfiguring our site.

Magento detects maintenance mode as follows:

If var/.maintenance.flag does not exist, maintenance mode is off and Magento operates normally. Otherwise, maintenance mode is on unless var/.maintenance.ip exists:

The var/.maintenance.ip can contain a list of IP addresses. If an entry point is accessed using HTTP and the client IP address corresponds to one of the entries in that list, then maintenance mode is off.

Add allowed IP during maintanace mode

php bin/magento maintenance:allow-ips xxx.xxx.xxx.xxx

Enable maintanace mode

php bin/magento maintenance:enable

Disable maintance mode

php bin/magento maintenance:disable

Need Help?

Do you need any help on Magento 2? I'm happy to help you.

Contact Me

Recent Posts

  1. Update query order - WordPress
  2. Display featured products - WooCommerce
  3. Remove "Category:", "Tag:", "Author:" from the_archive_title - WordPress
  4. The essential & basic WP-CLI commands for a WordPress developer
  5. Install theme unit test data using WP-CLI - WordPress


Questions / Comments

If you found this article interesting, found errors, or just want to discuss about them, please get in touch.