Du musst dich anmelden um Beiträge und Themen zu erstellen. Einloggen · Registrieren

Implement a Site-Maintenance Page for Your Blog

Ever do maintenance on your site? Certainly, we all do. Here’s an easy way to display a “site-maintenance” page that will display whatever content you desire. The key here is setting up your HTAccess file to handle the redirect properly.

First, you need to create your maintenance page. This can be as simple or as advanced as you would like. At minimum, you could include something like this into a file named “maintenance.html”:

<h1>Site Maintenance</h1>
<p>Please check back in 15 minutes</p>

Then, add this bit of voodoo to your site’s root htaccess file:

RewriteEngine on
RewriteCond %{REQUEST_URI} !/maintenance.html$
RewriteCond %{REMOTE_ADDR} !^111\.222\.333\.444
RewriteRule $/maintenance.html [R=302,L]

Once that’s in place, replace the example IP address with that of your own. Upload to your site and check it out. What you will see is that you have full access to your site, but all other visitors will see the maintenance page.

Once maintenance is complete, simply comment out the code in your htaccess file to allow visitors back into the site.

Source: WP-Mix.com