-
Put
maintenance.htmlinto your root directory -
Open
.htaccessfile -
Insert this block in the first line of the file
ErrorDocument 503 /maintenance.html RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f RewriteCond %{REQUEST_URI} !(/maintenance.html) RewriteRule ^.*$ - [R=503,L] -
Users except you will be redirected to
maintenance.html -
To disable maintenance mode just remove
maintenance.html
ErrorDocument 503 /maintenance.html is when user gets error 503, redirect the page to maintenance.html
RewriteRule ^.*$ - [R=503,L] does rewrite any url without replacing the url and access with 503