如何将用户重定向到另一个网站并仅允许机器人建立索引?

发布于 2024-10-06 21:49:09 字数 190 浏览 0 评论 0原文

我需要将所有用户重定向到当前的实时站点,并允许机器人为新站点建立索引。 我怎样才能实现这个目标?

如果是用户浏览则重定向到远程站点。

允许机器人索引已开发的站点

示例: 查找domain.com,如果这是一个正在浏览的用户,我将向他发送tom anotherdomain.com 如果是机器人,我让他继续浏览当前网站。

I need to redirect all the users to current live site and allow bots to index the new one.
How can I achieve this?

Redirect to remote site if it is user browsing.

Allow bot to index the devloped site

Example:
domain.com is looked up, if this is a user browsing I send him tom anotherdomain.com
if it is a bot I let him continue browsing current site.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不打扰别人 2024-10-13 21:49:09

我不知道你为什么想要合法地这样做,但是,正如所提出的问题......

# Determine if the User Agent is a Targetted Spider or Bot
SetEnvIfNoCase User-Agent "^Start of the Spider User-Agent String" is_bot
# Add as many lines as are needed here...

# Set the 403 Forbidden location as the Real Visitor Site
ErrorDocument 403 http://www.real-visitors-go-here.com/

# Apply the Targetted Spider or Bot Check to Access
<Limit GET POST>
order deny,allow
deny from all
allow from env=is_bot
</Limit>

我自己从来没有这样做过,但这是有道理的。

I have no idea why you would want to do this legitimately, but, as the question was asked...

# Determine if the User Agent is a Targetted Spider or Bot
SetEnvIfNoCase User-Agent "^Start of the Spider User-Agent String" is_bot
# Add as many lines as are needed here...

# Set the 403 Forbidden location as the Real Visitor Site
ErrorDocument 403 http://www.real-visitors-go-here.com/

# Apply the Targetted Spider or Bot Check to Access
<Limit GET POST>
order deny,allow
deny from all
allow from env=is_bot
</Limit>

Never done it myself, but that kind of makes sense.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文