Apache .htaccess disable access to site during Maintenance Mode / Deployment

Because I have to look this up from time to time, a note to myself: Add the contents below to your .htaccess to have Apache respond with a “Temporarily Unavailable” message in case a .maintenance file exists. — Handy during deploys RewriteEngine On # Show “Temporarily Unavailable” page if there’s a .maintenance file present RewriteCond […]


This content originally appeared on Bram.us and was authored by Bramus!

Because I have to look this up from time to time, a note to myself: Add the contents below to your .htaccess to have Apache respond with a “Temporarily Unavailable” message in case a .maintenance file exists. — Handy during deploys

RewriteEngine On

# Show "Temporarily Unavailable" page if there's a .maintenance file present
RewriteCond %{DOCUMENT_ROOT}/.maintenance -f
RewriteRule .* - [R=503,L]

~

Did this help you out? Like what you see?
Thank me with a coffee.

I don't do this for profit but a small one-time donation would surely put a smile on my face. Thanks!

☕️ Buy me a Coffee (€3)

To stay in the loop you can follow @bramus or follow @bramusblog on Twitter.


This content originally appeared on Bram.us and was authored by Bramus!


Print Share Comment Cite Upload Translate Updates
APA

Bramus! | Sciencx (2021-02-15T12:36:54+00:00) Apache .htaccess disable access to site during Maintenance Mode / Deployment. Retrieved from https://www.scien.cx/2021/02/15/apache-htaccess-disable-access-to-site-during-maintenance-mode-deployment/

MLA
" » Apache .htaccess disable access to site during Maintenance Mode / Deployment." Bramus! | Sciencx - Monday February 15, 2021, https://www.scien.cx/2021/02/15/apache-htaccess-disable-access-to-site-during-maintenance-mode-deployment/
HARVARD
Bramus! | Sciencx Monday February 15, 2021 » Apache .htaccess disable access to site during Maintenance Mode / Deployment., viewed ,<https://www.scien.cx/2021/02/15/apache-htaccess-disable-access-to-site-during-maintenance-mode-deployment/>
VANCOUVER
Bramus! | Sciencx - » Apache .htaccess disable access to site during Maintenance Mode / Deployment. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/02/15/apache-htaccess-disable-access-to-site-during-maintenance-mode-deployment/
CHICAGO
" » Apache .htaccess disable access to site during Maintenance Mode / Deployment." Bramus! | Sciencx - Accessed . https://www.scien.cx/2021/02/15/apache-htaccess-disable-access-to-site-during-maintenance-mode-deployment/
IEEE
" » Apache .htaccess disable access to site during Maintenance Mode / Deployment." Bramus! | Sciencx [Online]. Available: https://www.scien.cx/2021/02/15/apache-htaccess-disable-access-to-site-during-maintenance-mode-deployment/. [Accessed: ]
rf:citation
» Apache .htaccess disable access to site during Maintenance Mode / Deployment | Bramus! | Sciencx | https://www.scien.cx/2021/02/15/apache-htaccess-disable-access-to-site-during-maintenance-mode-deployment/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.