Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I make site offline?
#1
I want to make my site offline while I work on it. Would someone mind telling me how to do that?

thanks.
Reply
#2
There is no built in way to do maintenance mode.
You could do a deny all in htaccess.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
Thanks Shawn... appreciate it!
Reply
#4
I don't need it very often, so I have a fully-manual method for putting up a 'Maintenance' message, but still allowing me to access the site.

It involves adding a few lines to the root .htaccess file (which can be simply commented when not required) and a maintenance page, also in the root directory.

Add to root .htaccess, immediately below the existing RewriteBase line:
Code:
### Maintenance Mode ###

## Add current IP address in next line:
#RewriteCond %{REMOTE_ADDR} !^xxx\.xxx\.xxx\.xxx$

#RewriteCond %{REQUEST_URI} !^/maint\.php$
#RewriteRule ^(.*)$ maint\.php [L]

### end of Maintenance Mode ###

Add the file maint.php~ (with the trailing tilde) in the website root:
PHP Code:
<?php
  header
('HTTP/1.1 503 Service Temporarily Unavailable',true,503);
  
header('Status: 503 Service Temporarily Unavailable');
  
header('Retry-After: 43200');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
  <title>Site Maintenance</title>
</head>
<body>
  <h1>Maintenance</h1>
  <p>The website is undergoing maintenance at present.</p>
  <p>We hope to be finished later today: please try again soon.</p>
</body>
</html> 

To enable maintenance mode, insert the current public IP address of your workstation and remove the single comment marks from three lines in .htaccess; rename maint.php~ to maint.php. Return the site to live condition by reversing this.

Your current public IP address can be found from, for example, http://www.whatsmyip.org/.
--
Nick.
Reply
#5
Thanks a lot Nick, That's a great way to put up a temp Maintenance mode.

Appreciate your help,
jumper
Reply
#6
or quick and dirty without pretty handling

order allow,deny
allow from 255.0.0.0
deny from all
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#7
If you need to cease down only main, index page for a short amount of time, just upload a prepared index.html into your root directory.
Assuming that .htm/.html files have higher priority than .php, incoming users will see index.html page.
Addons: blue business theme, Online Visitors, Notepad
Reply




Users browsing this thread: 1 Guest(s)