Latest News: (loading..)

Archived

This topic is now archived and is closed to further replies.

14steve14

Site down for maintenance using htaccess

3 posts in this topic

I needed a quick and easy method of temporarily closing my live site to all visitors apart from myself. I searched and found the following.

 

Create a new page called 'maintenance.html' and upload it to your sites root folder. Do not include any images, but add whatever text you like and preferably add a time when the site will be back online. This just helps keep your customers informed.

 

Add to the start of your root folders htacess file

 

# MAINTENANCE-PAGE REDIRECT

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000

RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC]

RewriteRule .* /maintenance.html [R=302,L]

</IfModule>

 

Change the part of the code that is in red to your ip address keeping the \. and save the changes.

 

Now you should be able to access your site, whilst sending all other visitors to your maintenance page.

 

This worked for me so i thought i would share.

Share this post


Link to post
Share on other sites

There are several more sophisticaled down for maintenance/ holiday/vacation add-ons which you can enable from the admin page but the above will work too!!

 

Cheers

 

G

Share this post


Link to post
Share on other sites