When the maintenance mode curtain is drawn across your Statamic site, it's not just the public who are kept at bay --- users who try to access the control panel might also find themselves locked out. But fear not, for the sanctum of the control panel is not impenetrable. With the right know-how, administrators can waltz through maintenance mode and get down to business as usual. Let's uncover the steps to access your Statamic control panel, even amidst the hush of maintenance mode.
Understanding Maintenance Mode
Statamic, being built on Laravel, inherits the framework's maintenance mode feature, which is used when you need to perform updates or maintenance on your site. During this period, a user-friendly message informs your visitors that the site is temporarily unavailable. However, for administrators, work must go on, and accessing the control panel is crucial.
Step-by-Step Access
- Activate Maintenance Mode: First things first, you'll need to activate maintenance mode. This can be done through the command line with the following Artisan command:
php please down
Or, if you prefer the Laravel native command:
php artisan down
- Secret Access: Laravel's maintenance mode comes with a handy option to allow access to your application via a secret phrase appended to the URL. When you run the down command, append
--secret="your-secret-phrase"
like so:
php artisan down --secret="letmein"
Replace "letmein"
with a secret phrase of your choice.
- Navigate to Your Secret URL: After maintenance mode is activated with a secret, you can access your site's frontend by navigating to:
http://yourdomain.com/your-secret-phrase
This will give you a bypass cookie that allows you to access your site normally.
- Access the Control Panel: Once you have the bypass cookie, access the control panel as you normally would by going to:
http://yourdomain.com/cp
-
Perform Administrative Tasks: With access to the control panel, you can manage your content, run updates, or perform any necessary tasks as needed.
-
Exiting Maintenance Mode: When you're ready to take your site live again, simply run:
php please up
Or, the Laravel equivalent:
php artisan up
This will lift the maintenance mode and allow visitors to access your site once more.
Tips for Smooth Sailing
- Always inform your team before you put the site into maintenance mode to avoid confusion.
- Ensure that your secret phrase is complex and not easily guessable to maintain security.
- Don't forget to test any changes you make in a local or staging environment before making them live.