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

6 Answers6

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.

Chris S
  • 77,337
  • 11
  • 120
  • 212
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)
Pascal Schmiel
  • 1,728
  • 12
  • 17
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
Lucas Kauffman
  • 16,818
  • 9
  • 57
  • 92
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

Jon Totham
  • 151
  • 3
0

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

NickW
  • 10,183
  • 1
  • 18
  • 26
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.

Nathan C
  • 14,901
  • 4
  • 42
  • 62