Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

my website is new and there is tons of things i want to take care of before i open the website to public but i'm afraid of that maybe someone will visit the website using google like they searched about something and they found my website in the results you know what i mean so could you please tell me what to do to block all traffic and allow me only

i'm using cpanel

waiting for your respond

thank you so much for your help

share|improve this question

closed as off topic by Lucas Kauffman, mulaz, mdpc, growse, kce May 14 '13 at 23:05

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Is this hosted or do you have full control yourself? –  Lucas Kauffman May 14 '13 at 15:57

6 Answers 6

Develop your site in a Development Environment, like say your personal computer.
Then upload it to your hosting when it's ready to be deployed.

share|improve this answer

Use a .htaccess file to block access from all IPs and then allow your public IP

order deny,allow
deny from all
allow from 123.123.123.123 #(replace with your IP)
share|improve this answer

What you can do is make the website only accessible to localhost and then, by using port forwarding, you can tunnel all traffic to your localhost.

For instance:

ssh -L 81:yourIP:80 username

This would forward all traffic to port 80 on your webserver to port 81 on your localhost. So if you open your browser an go to http://127.0.0.1:81 you should see your website.

To only allow traffic from localhost you can use .htaccess :

order allow,deny
allow from 127.0.0.1
deny from all
share|improve this answer

You want to use a .htaccess file in the root folder of your website, this will allow you to either whitelist by IP or password protect the website until you're ready to show it off to the world.

cPanel has a 'Password Protect Directories' button that will build the .htaccess files for you.

There is a handy guide for doing this on both cPanel and by hand here http://viralpatel.net/blogs/password-protect-your-webpages-using-htaccess/

Hope this helps.

J

share|improve this answer
    
This is the right way to do this when running on cPanel –  SimonJGreen May 14 '13 at 16:14
    
thank you so much for your help –  Richard Williams May 14 '13 at 19:37

Pretty simple, set up an .htaccess file, the page I linked to is the full documentation, but you can also follow a tutorial

share|improve this answer

Make a robots.txt file in the root of your website and put the following in it:

User-agent: *
Disallow: /

You're now invisible to search engines.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.