brittbr2
Member
- Messages
- 99
- Reaction score
- 11
- Points
- 8
Using .Htaccess
If you are using the Apache server, you can use.htaccess to control access of the directories within the server, and send a response code of the server status.
To put the website into maintenance mode, you can use the 503 status code, which indicates that the server is temporarily unavailable.
Before we specify anything in .htaccess, however, we need to create a new file in.html or.php format, and add a message in the file, e.g.
Sorry we are down for maintenance, but we’ll be back up shortly.
Style your page. Next, open the .htaccess file in your server, and add the following:
If you are using the Apache server, you can use.htaccess to control access of the directories within the server, and send a response code of the server status.
To put the website into maintenance mode, you can use the 503 status code, which indicates that the server is temporarily unavailable.
Before we specify anything in .htaccess, however, we need to create a new file in.html or.php format, and add a message in the file, e.g.
Sorry we are down for maintenance, but we’ll be back up shortly.
Style your page. Next, open the .htaccess file in your server, and add the following:
- <IfModule mod_rewrite.c>
- RewriteEngine on
- RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000
- RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC]
- RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
- RewriteRule .* /maintenance.html [R=503,L]
- </IfModule>