如何在没有 Robots.txt 的情况下对搜索引擎隐藏网站目录? [英] How to hide website directory from search engines without Robots.txt?

查看:38
本文介绍了如何在没有 Robots.txt 的情况下对搜索引擎隐藏网站目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们知道我们可以使用 robots.txt 阻止搜索引擎索引我们网站上的目录.

We know we can stop search engines from indexing directories on our site using robots.txt.

但这当然有一个缺点,即实际上公开了我们不想被可能的攻击者发现的目录.

But this of course has the disadvantage of actually publicising directories we don't want found to possible attackers.

使用 .htaccess 或其他方式保护目录的密码显然是保持目录私密的最佳方式.

Password protecting the directory using .htaccess or other means is obviously the best way to keep the directory private.

但是,如果为了方便起见,我们不想为目录添加另一层安全性,而只想添加另一层混淆呢?例如,隐藏管理员登录页面.

But what if, for reasons of convenience, we didn't want to add another layer of security to the directory and just wanted to add another level of obfuscation? To hide, for example, an admin login page.

是否有另一种方法可以隐藏"目录而不在 robots.txt 文件中广播其位置?

Is there another way to "hide" the directory without broadcasting its location in a robots.txt file?

推荐答案

这里是做什么,请注意,因为你没有提到我没有包括的任何特定技术如何 去做.

Here is what to do, please note as you haven't mentioned any particular technology I haven't included how to do it.

如果您将网络服务器配置为在目录列表 HTML 页面中输出以下 meta 标记,它将防止您的页面被合规的搜索引擎编入索引.

If you configure your web server to output the following meta tag in the directory listing HTML page, it will prevent your page from being indexed by compliant search engines.

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

添加这可能需要在您的 Web 服务器中实现一个自定义模块,该模块将覆盖默认目录列表输出页面.

Adding this would probably require implementing a custom module within your web server that will override the default directory listing output page.

这篇关于如何在没有 Robots.txt 的情况下对搜索引擎隐藏网站目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆