Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My site, www.example.com has a MyBB forum installation, and has many users constantly checking it out. I would like to make a major change to it - basically, I want to delete everything it has and start clean.

However, this rebuilding process may take me hours since I need to do a lot of things. Thus, whenever an user tries to enter any part of my site (www.example.com, www.example.com/blog etc), the user will always be redirected to www.example.com/underconstruction so they can see a nice HTML site explaining the current situation.

But not only that - while I am configuring my site, I need to visit it myself to make sure things do work live. So basically, it has to redirect everyone who isn't me.

Is that possible in any way? I am using GoDaddy hosting.

share|improve this question
up vote 3 down vote accepted

Try using .htaccess!

# Turn on mod_rewrite 
RewriteEngine On

# If not your IP address 
RewriteCond %{REMOTE_ADDR} !^**\.**\.**\.**

# and not the temporary page 
RewriteCond %{REQUEST_URI} !^/maintenance\.

# redirect to temporary page 
RewriteRule /*$ /maintenance.php [L]

I think the above might help you a whole bunch!

share|improve this answer
It works. Thank you. – Omega Dec 21 '12 at 1:26
@Omega No problem. Glad to be of service. – ILikeTurtles May 23 '13 at 14:45

I'd make backups especially of your database if you are starting over. I'm sure you already will though.

To redirect everyone but yourself you can add this to your .htaccess file

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !=
RewriteRule /*$ /maintenance.php [R=301,L]

This will redirect all users except you to a maintenance.php page

share|improve this answer
Your RewriteRule only redirects users that access index.php, is that intentional? – w3dk Dec 16 '12 at 1:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.