Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MythicFrost

macrumors 68040
Original poster
Mar 11, 2009
3,944
40
Australia
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
 
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
 
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
 
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
 
I'm wondering what stops someone from navigating to mysitesecondpage, just by typing it in the URL, without visiting mysite/firstpage?

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.