galvin Posted September 14, 2011 Share Posted September 14, 2011 Is there an easy way to have a site live, but only have it visible to me. In other words, I'll be building the site while it's live and don't want anyone going to it accidentally until it's ready. Before everyone jumps down my throat , I know all developing/testing should be done locally, but I'm just curious if there is an easy way to keep a site private if it must be developed while live. I guess making a simple login would do it. But then I'd have to have code on every page that says "if not logged in, don't allow to see this page". I guess i could put that code in a header include file to avoid having to add it to every page manually. Ok, sorry for that, but I think I just talked myself into how to do it. But I'm going to post the question anyway in case there is a better/smarter way. Thanks everyone! Quote Link to comment Share on other sites More sharing options...
ManiacDan Posted September 14, 2011 Share Posted September 14, 2011 Don't tell anyone where it is and don't point a domain name to it. Also, configure apache to do authentication, then you can secure the whole webserver. You can remove that one apache directive the day you want to go live. -Dan Quote Link to comment Share on other sites More sharing options...
MarPlo Posted September 14, 2011 Share Posted September 14, 2011 Hi, You can create a .htaccess file having this code: order allow,deny deny from all allow from your_ip - replace "your_ip" wityh youur IP. Quote Link to comment Share on other sites More sharing options...
galvin Posted September 14, 2011 Author Share Posted September 14, 2011 Thanks both of you! MarPlo, I did what you said and it blocked me from getting there (which is what I wanted). Then I added my IP address per your instructions, yet I still can't access it from that IP. I added... order allow,deny deny from all allow from XXX.XXX.XX.X (with the X's being my actual IP of course). So just curious if you know of anything that might prevent this from working as intended? Quote Link to comment Share on other sites More sharing options...
galvin Posted September 14, 2011 Author Share Posted September 14, 2011 Figured it out, had to reverse the order of allow,deny in the first line to say "deny,allow" instead. Works now. Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.