How do I redirect everyone but myself while working on the root of my site?

Jamie

Well-known member
I want to get ready to move over to xF. Currently my set up is like this:

root <- nothing major there. Only a index.html file with a redirect to my /forums. (It was using IP.Content) but I gave up on trying to get that to work like I wanted it, so there isn't anything in the root.

/forums < - currently holding my IPB site. I would like this to remain active during this process.

My plans are to put xF in /community and then wordpress in the root. While working and doing this I don't want anyone but myself to be able to reach the root directory or the newly created /community directory.

I think this can be done through .htaccess but I am not 100% sure and if it can I am not sure on how to do it.

Any help with this would be greatly appreciated.

Jamie
 
Just place an .htaccess file in your root like so:

Code:
Options All -Indexes
DirectoryIndex home.php

Where home.php is the page you want to redirect to.

You might also have to put a temporary .htacess in the /community directory with the same content, just change the path to the redirected holding page or put another one in the same directory.

The home.php doesn't have to be anything fancy, just some plain text stating: "The site is being rebuilt, check back later" or something to that effect.

Of course this means you also won't be able to access the root but you will be able to load specific files, and FTP, etc.

The other way to do it is to password/IP protect the directories but that's a bit more complicated and overkill for this situation in my opinion.
 
Thanks, but I thought I read somewhere in these forums, sorry can't find it now, but I thought I read that you could restrict it by the ip address. This way I could access both the root and /community getting everything set up before it is opened.

Jamie
 
I found this on another another. Since I am not exactly sure, I thought I would post what they suggested and check to make sure it makes sense.

Would this work?

Code:
# Where you want to redirect to

ErrorDocument 403 http://example.com/page.html

order deny,allow

# You want everyone blocked

deny from all

# Except for your IP (replace with your IP)

allow from 60.118.156.100

Thanks for the double check on this.

Jamie
 
Thanks, but I thought I read somewhere in these forums, sorry can't find it now, but I thought I read that you could restrict it by the ip address.

Yes, as I said at the end of my post, you can IP protect the directory.

You can do that as follows:
Code:
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Change the 127.0.0.1 to your IP address.
 
No problem :)

Just remember if you have dynamic IP address allocation by your ISP you will have to update the .htaccess file every 24 hours.
 
Thanks, I have a static ip. This will work well, now I have build the site and get it ready to go live with the installation, installing the couple of mods, getting the imports done and all ready to open without having to rush though it all while the site is down.

Jamie
 
Yes, it's a good approach to take as you don't want anyone stumbling across your new site as you're building it.

Another way would be to install it in a directory other than /community and then move it once completed.
For example you could create a directory with a completely random name such as /kkspqk5389sd and work on it there.

If someone managed to find that then they probably deserve to see what you're up to :D
 
Would you actually move the files when you're done or just redirect them? I have a test site I have been playing with, but though I would set it up this way and then leave the test site for future playing and testing. If I could just copy over the files, and move them that might be easier than redoing everything. :)

Although redoing them will give me more experience with this and where everything is...

Jamie
 
If you want the site url to be www.mysite.com/community then you would have to move/rename the directory (and update the board URL in the ACP).

I'm actually building mine locally and then I'll just FTP everything and import the database once it's ready.
 
It only takes a few seconds to move files/directories around using cPanel. My personal approach will be to set things up in a password protected directory such as testxf and when ready for the switch (and the live forums are offline) move things around.
 
Thanks guy, that is the way I am going to go. It makes sense, I have been working on a test site, so I will build that out to the way I want it and then move it when we go live.

Thanks!

Jamie
 
If you really want to get... (not sure what the right word is), this is what we did.

  • mysite.com/forums is the live site
  • mysite.com/testxf is that password protected site.
  • mysite.org points to mysite.com/testxf - that way select users can be given the password and walked through live (in person, or at least with audio) to really test the user experience. The people think it is an entirely different site somewhere else. That also will allow us to really test the entire setup using the mysite.org as the url. Then change the .org with .com, and move the /testxf to where ever we decide using cpanel.
 
Top Bottom