I want to customize maintenance mode in Magento2.
Magento2 error message will be hide and my custom message will be visible.
If you know anything related to this then share with me.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
Create a copy of the
pub/errors/local.xml.sample file and update the skin name within to something unique. I usually use the current theme name, say
bigeyedeers. So the local.xml file should look something like so
<?xml version="1.0"?> <config> <skin>bigeyedeers</skin> <report> <action>print</action> <subject>Store Debug Information</subject> <email_address></email_address> <trash>leave</trash> <dir_nesting_level>0</dir_nesting_level> </report> </config>
Then copy the
pub/errors/default folder to what ever skin name you chose in the local.xml
cp -r pub/errors/default pub/errors/bigeyedeers
Now you can update 503.phtml with your custom maintenance page content
The recommended way in Magento 2 is by updating the server config, see the following link for more details.
I haven't tried using a Magento module to change the maintenance page before and would recommend against it. But the logic that handles detecting maintenance mode and throwing the 503 is within
lib/internal/Magento/Framework/App/Bootstrap.php:assertMaintenance(). Overwriting this method and requiring your html file then exiting may work.