This is one of those blog articles you probably don’t need today but may need one day down the road. For that reason, I suggest you bookmark it in case you ever need to know how to do this.
Sometimes as bloggers and website owners there comes a need to temporarily redirect all our site visitors to a temporary maintenance page. If you’re a WordPress blogger, there is a maintenance page plugin you can use to accomplish this; however, that plugin is limited, crutched by the fact that you actually have to have your WordPress site in good working order.
But what happens if you one day find your site was hacked and some malicious asshole posts a bunch of spam or porn links on your site and your WordPress Dashboard isn’t working as it should? What if you had no access to your WordPress admin area at all?
What then?
A plugin won’t help.
So if you ever come to a point where you need to redirect everyone but yourself to a temp maintenance page, here’s how you do it through your web hosting control panel (apart from WordPress).
How To Create A Maintenance Page Redirect
Step 1
Create a simple html file and place it in your blog’s root directory. Name it something like, maintenance.html. Inside the maintenance.html file you can put anything you want. “Hi. I’m out to lunch for a few moments while the construction crew is busy at work . . .”
But why stop there? Your site is better than that. Customize the page with your site’s colors and images. Maybe add a video or your latest blog post. CSSgirl wrote some tips and shows some examples on the topic of creating a memorable maintenance page.
Step 2
Ok so now you have your maintenance.html page set up, the next step is to redirect everyone to it while you’re doing whatever it is you need to do.
Navigate to your blog’s root directory in your web hosting control panel and open your .htaccess file.

Once opened, you’re going to add this code at the top:
# Use this code to redirect visitors to maintenance.html file while upgrading
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^618\.124\.259\.25
RewriteCond %{REQUEST_URI} !/maintenance.html$
RewriteRule $ http://your-site.com/maintenance.html [R=302,L]
The yellow parts above are the areas you need to change. Visit What is my IP address? to find your IP address and put those numbers in under the first yellow highlight. Next add the url path to your own maintenance page in the second yellow part.
And that should do it. Your site should now show a maintenance page to everyone except you (your IP address was whitelisted). To see what everyone else sees, add a # sign in front of the IP line:
# RewriteCond %{REMOTE_ADDR} !^618\.124\.259\.25
The # comments lines out.
When you’re finished, leave the code in your .htaccess file for next time. To disable the code, just add a # in front of each line:
# Use this code to redirect visitors to maintenance.html file while upgrading
# Options +FollowSymlinks
# RewriteEngine on
# RewriteCond %{REMOTE_ADDR} !^618\.124\.259\.25
# RewriteCond %{REQUEST_URI} !/maintenance.html$
# RewriteRule $ http://your-site.com/maintenance.html [R=302,L]
Remember, if you need help with upgrades or WordPress security, visit the blog services page and use the contact form there to get in touch with me.
Like tutorials like these? Keep up with what we’re doing over here by subscribing to our feed.
















December 2nd, 2009 at 8:15 pm
Can we also apply this technique to our Error 404 page not found situations? lately, I have been receiving those reports from my readers.
Rian´s last blog ..Smart Bro Share It Slow Connections – Your Share It Router Might be Defective
December 2nd, 2009 at 8:34 pm
Hi Rian. You couldn’t really use this particular technique because it limits who has access to your site (or if configured, a particular page) to just you.
But… here’s what you can do.
What you need to know is what urls are creating the 404s. Go to Google Webmaster Tools and if you don’t already have a Google account, sign up. From there, you’ll see a way which you can have Google show you all the 404s your website is creating (all the bad links).
Then what you can do is redirect all those bad links to where you want the person to go.
Open up your root .htaccess file and use a code similar to this:
Redirect 301 /a-list-bloggers-are-different/ http://wpbloghost.com/blog/a-list-bloggers-are-different/
I had to do this when I moved my blog into the subdirectory, /blog.
The 301 is telling Google to permanently forget about the old url (the first one) and index it now as this new one (the second one).
You can do this for each of your 404s.
If it’s just a temporary redirect, use code 302.
December 12th, 2009 at 12:32 pm
Hi John
Could have used this post earlier today but I was keen to get my site looking good.
I’ve spent most of the day uploading and configuring my theme and I am more than pleased with it.
Thanks for your help and endless patience along the way and I will certainly implement a maintenance page for the future.
Have a good Christmas
Keith Davis´s last blog ..The eyes have it!
December 12th, 2009 at 2:04 pm
Hey Keith – I love the new template. It’s very warm and easy to read. Don’t forget that RSS subscribe image.
It’s been my pleasure and you have a good Christmas, too. We went out and picked up a tree today and the wife and I just finished putting the lights in.
December 12th, 2009 at 2:16 pm
Thanks John
I’ll put the “WP Blog Host” graphic link on tomorrow.
Perhaps in the new year you can say a bit more about the RSS Subscribe image.
Keith Davis´s last blog ..The eyes have it!
December 12th, 2009 at 2:44 pm
Got that right here for you, Keith:
A Complete Guide To Setting Up FeedBurner on WordPress.
December 23rd, 2009 at 6:36 pm
This will be a big help thank you! My only problem is my maintanance.html page is not showing the jpg that is embedded in the page, otherwise the page is being delivered by the redirect just fine. Any reason why that would be?