Stop people from accessing my site?

Discussion in 'Web Design and Development' started by MythicFrost, Aug 9, 2009.

  1. MythicFrost macrumors 68040

    MythicFrost

    Joined:
    Mar 11, 2009
    Location:
    Australia
    #1
    Ok, I'm about ready to register the domain I've purchased with a host (I think that's what it's called), so I can go to mysite.com and it's there.

    I've got a local server that I'm testing on now, when I upload it... how do I stop "anyone" from going there? is there a setting that allows only you or what?

    Anyone know? I'm a little cautious :O

    Kind Regards
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    If it's an Apache web server you have a couple options.

    Use password protection. (Some hosts offer an interface for this, which make sit easier than the details outlined in the link)

    Only allow local IP addresses from within a .htaccess file. (Access Control)
    Code:
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
    Allow from localhost
     
  3. Cerebrus' Maw macrumors 6502

    Joined:
    Mar 9, 2008
    Location:
    Brisbane, Australia
    #3
    You could use the .htpasswd file for password protection if you are using an Apache server.

    Or you could use a site wide redirect, to redirect anyone who goes to your site, for any page, and redirect them to one page all the time.

    Edit: Damn you angelwatt :p
     
  4. MythicFrost thread starter macrumors 68040

    MythicFrost

    Joined:
    Mar 11, 2009
    Location:
    Australia
    #4
    Thanks a lot angelwatt & Cerebrus' Maw.

    I'm wondering what stops someone from navigating to mysitesecondpage, just by typing it in the URL, without visiting mysite/firstpage?

    Kind Regards
     
  5. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #5
    Well, if you password protect it, then they'll be stopped by the prompt for a user name and password. The protection applies to the entire directory and its contents, so if applied to the root, the entire site is protected. If you do the control access method, then they'll see a "403 Forbidden" message. Sub-content is protected the same way as password protecting; everything inside the site is protected.
     

Share This Page