0

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

1
  • Is this hosted or do you have full control yourself? May 14, 2013 at 15:57

6 Answers 6

2

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.

2

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)
2

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
2

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

1
  • This is the right way to do this when running on cPanel May 14, 2013 at 16:14
0

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

0

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.

Not the answer you're looking for? Browse other questions tagged .