I'm looking to set up a small static website that is exclusively for my friends to access—not indexed by search engines like Google. I want to make sure that the only way to enter the site is through a direct link, and I prefer a hosting provider rather than using my own hardware for security reasons. The website will consist of basic HTML, CSS, and JavaScript files, adding up to less than 10MB. I'm not worried about the upload limit; I just want it to be 'private' and free of charge. Any suggestions?
5 Answers
Using an IP address instead of a domain name could work too! Just share the IP with your friends; Google rarely indexes raw IPs. Plus, adding a difficult-to-guess path to your URL could help keep it under the radar.
One easy way is to use a `robots.txt` file, which can tell search engines not to index your site. But if you really want to keep it away from prying eyes, you might consider adding a password protection using an `.htaccess` file—just give your friends the password. It's straightforward and pretty effective!
If you're okay with a bit of setup, using basic HTTP authentication is a good move. Just set a username and password for access. An alternative might be serving your site with a self-signed SSL certificate so that your friends can access it securely, even if it’s not exposed publicly.
You can easily password protect your website’s directory once you have hosting set up. Just share the username and password with your friends. Another option is to create a direct link with credentials like `https://username:[email protected]`, but that’s not very secure since anyone could access it.
Another option is to create a simple meta tag that tells search engines not to index your site: ``. Combine that with some client-side JavaScript that only shows your content if a specific query string is present. This way, it's less likely to be indexed, and users need that specific link to see anything.

True, but keep in mind that `.htaccess` is just a layer of security. If your site is public, it'll still be accessible if someone gets hold of the password!