如何制作私有网址?
我想创建一个私人网址,
http://domain.com/content.php?secret_token=XXXXX
然后,只有拥有确切网址(例如通过电子邮件收到)的访问者才能看到该页面。我们在显示内容之前检查 $_GET['secret_token']
。
我的问题是,如果搜索机器人有机会找到该 URL,它们将简单地对其进行索引,并且该 URL 将是公开的。有没有实用的方法来避免机器人访问和后续索引?
可能但不利的方法:
登录系统(例如通过 php 会话):但我不想提供用户登录。
受密码保护的文件夹:问题如上。
使用Robots.txt:许多搜索引擎机器人不尊重它。
I want to create a private url as
http://domain.com/content.php?secret_token=XXXXX
Then, only visitors who have the exact URL (e.g. received by email) can see the page. We check the $_GET['secret_token']
before displaying the content.
My problem is that if by any chance search bots find the URL, they will simply index it and the URL will be public. Is there a practical method to avoid bot visits and subsequent index?
Possible But Unfavorable Methods:
Login system (e.g. by php session): But I do not want to offer user login.
Password-protected folder: The problem is as above.
Using Robots.txt: Many search engine bots do not respect it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
你所说的是通过默默无闻实现安全。这从来都不是一个好主意。如果您必须这样做,我会提供以下想法:
What you are talking about is security through obscurity. Its never a good idea. If you must, I would offer these thoughts:
尝试生成一个 5-6 字母数字密码并附加到电子邮件中,这样即使机器人抓取它,它们也需要密码才能访问该页面。 (只是额外的安全措施)
Try generating a 5-6 alphanumeric password and attach along with the email, so eventhough robots spider it , they need password to access the page. (Just an extra added safety measure)
view),机器人找不到它
view), the robot won't find it
只要您不链接到它,蜘蛛就不会拾取它。而且,由于您不需要任何密码保护,因此该链接适用于所有人。考虑在使用密钥后将其禁用。
As long as you don't link to it, no spider will pick it up. And, since you don't want any password protection, the link is going to work for everyone. Consider disabling the secret key after it is used.
您只需要告诉搜索引擎不要索引
/content.php
,并且尊重robots.txt
的搜索引擎不会索引任何以/content 开头的页面.php
。you only need to tell the search engines not to index
/content.php
, and search engines that honorrobots.txt
wont index any pages that start with/content.php
.在大多数情况下,不发布链接是可以的……
但是,我会警告您,浏览器工具栏(想到谷歌和雅虎)的流行改变了游戏规则。我工作过的一家公司的网页来自其内部网已在 Google 中建立索引。您可以搜索该页面,然后会出现一些结果,但除非您位于我们的防火墙或 VPN 内,否则您无法访问它们。
我们认为这些链接传播到 Google 的唯一方法必须是通过工具栏。 (如果其他人有更好的解释,我很想听听......)我已经离开那家公司有一段时间了,所以我不知道他们是否已经弄清楚那里发生了什么。
我知道,奇怪但真实......
Leaving the link unpublished will be ok in most circumstances...
...However, I will warn you that the prevalence of browser toolbars (Google and Yahoo come to mind) change the game. One company I worked for had pages from their intranet indexed in Google. You could search for the page, and a few results came up, but you couldn't access them unless you were inside our firewall or VPN'd in.
We figured the only way those links got propagated to Google had to be through the toolbar. (If anyone else has a better explanation, I'd love to hear it...) I've been out of that company a while now, so I don't know if they ever figured out definitively what happened there.
I know, strange but true...