Create a file named as maintenance.flag and upload it to Magento home directory containing following code.
$maintenanceFile = ‘maintenance.flag’;
if (file_exists($maintenanceFile)) {
include_once dirname(__FILE__) . ‘/errors/503.php’;
exit;
}
To enable Maintenance mode in Magento, you would typically follow these steps:
- SSH Access or FTP Access: Firstly, you need access to your Magento installation directory via SSH or FTP.
- Navigate to Root Directory: Using your preferred method of access, navigate to the root directory of your Magento installation.
- Create Maintenance.flag File: Within the root directory, create a file named
maintenance.flag
. This file tells Magento that maintenance mode is enabled.bashtouch maintenance.flag
- Verify Maintenance Mode: After creating the
maintenance.flag
file, maintenance mode should now be enabled. Users accessing your Magento store will see a maintenance page instead of the regular storefront. - Disable Maintenance Mode: To disable maintenance mode and allow normal access to your store, simply delete the
maintenance.flag
file from the root directory.bashrm maintenance.flag
Alternatively, if you prefer a more GUI-based approach, you can also enable maintenance mode through the Magento Admin Panel by following these steps:
- Log in to your Magento Admin Panel.
- Navigate to System > Tools > Maintenance Mode.
- Toggle the option to enable maintenance mode.
- Save the changes.
Please note that the exact steps may vary depending on the Magento version you are using, but these general steps should work for most versions.