.htaccess Maintenance Redirect

In my line of work, I deal with a lot of people performing maintenance on their website. I often get asked how to put a redirect in place to a maintenance page or area. I get asked so much, in fact, I decided to post this on my blog.

By using the following code within a .htaccess file, you will be able to direct visitors to a maintenance page no matter which part of your site they request. You will want to use your own file name, of course, if maintenance.php does not suit you. Once your maintenance has completed, you can simply delete the code from the .htaccess file or comment it out (by adding ‘#’ to each line, at the beginning).

If you need to redirect all visitors to the maintenance page, but you still want to have access (or possibly, a developer), you can modify the above code to the following. You will need to change the IP address to that of your own or whoever you wish to give access to.

It is as simple as that. Have fun!

Share...Email this to someoneShare on Facebook0Share on Google+0Share on LinkedIn0Share on Reddit0Tweet about this on Twitter0

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">