1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'XenForo Questions and Support' started by Jamie, Nov 17, 2010.

  1. Jamie

    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.

  2. Brogan

    Brogan XenForo Moderator Staff Member

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

    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.
  3. Jamie

    Jamie Well-Known Member

    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.

  4. Jamie

    Jamie Well-Known Member

    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?

    # 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
    Thanks for the double check on this.

  5. Brogan

    Brogan XenForo Moderator Staff Member

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

    You can do that as follows:
    Order Deny,Allow
    Deny from all
    Allow from
    Change the to your IP address.
    Jamie likes this.
  6. Jamie

    Jamie Well-Known Member

    Ah, ok! Thanks sorry for being so slow on these things.. I barely know enough to be dangerous. :)

  7. Brogan

    Brogan XenForo Moderator Staff Member

    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.
  8. Jamie

    Jamie Well-Known Member

    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.

  9. Brogan

    Brogan XenForo Moderator Staff Member

    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
  10. Jamie

    Jamie Well-Known Member

    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...

  11. Brogan

    Brogan XenForo Moderator Staff Member

    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.
  12. Dean

    Dean Well-Known Member

    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.
  13. Jamie

    Jamie Well-Known Member

    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.


  14. Dean

    Dean Well-Known Member

    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.

Share This Page