Question

How can I hide my website so that only the computers I choose can access it?

Posted May 6, 2020 163 views
Applications

Hello, I am new to the digital ocean and actually also to the use of Linux servers, currently I need to prevent my site from being accessible by a search engine, I wish I could choose which devices can access it, since I only need them to access my site about 10 users who are in different geographical areas

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi @darkdevil333666,

You can achieve any of that with a few simple rules. Firstly, in order to prevent search engines to actually list it you can make a lot of changes. The first I can think of is adding a meta tag like so

<meta name="robots" content="noindex">

A better approach for your requirements is actually denying the website for the public. If you know the people that are going to be using it, you’ll just need to get their IP addresses and allow only them.

Another approach might be setting up a password protected website. That way you can provide the people that need access with the password and only they will be able to login. To do that, you’ll need to use Apache and add the following to your .htaccess

AuthType Basic 
AuthName "/path/to/protected/folder" 
AuthUserFile //path/to/protected/folder/.htpasswd 
require valid-user

You’ll need to change the path with your actual one. You’ll need to add the user you’ll want to access the website with in the /path/to/protected/folder/.htpasswd file.

That’s it, every way of the mentioned should actually work for you. Now, it depends which one would you feel will suite you best.

Regards,
KDSys

Submit an Answer