Correct way to add robots.txt file and hide it?

I have a secret folder on my hosting that visitors may not see. I added robots.txtin htdocs:

User-agent: *
Disallow: /super-private/

However, if the visitor goes to http://example.com/robots.txt , he can see the name of the private folder. Is there anything that can be done? May be?

+3
source share
2 answers

robots.txthere is not a solution. All he does is say things, such as search engine spiders, that a specific URL should not be indexed; It does not block access.

Put the file .htaccessin super-privatecontaining the following:

Deny From All

, robots.txt, . , .htaccess.

+7

robots.txt. .htaccess:

deny from all

, super-private, , , , .

+2

Source: https://habr.com/ru/post/1779823/


All Articles