2

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.

3

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!

  • @Omega No problem. Glad to be of service. – ILikeTurtles May 23 '13 at 14:45
0

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} !=123.45.67.89
RewriteRule /*$ /maintenance.php [R=301,L]

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

  • Your RewriteRule only redirects users that access index.php, is that intentional? – MrWhite Dec 16 '12 at 1:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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