大网数据广告活动
网站运营与故障问答

Do you need to add 301 redirect rules into robots.txt for search engines when you specify them in .htaccess?

· 52CE 我爱测

Do I need to add 301 redirects to the robots.txt file? I will be adding the redirects to the .htaccess file, but not sure if the search engines need them in the robots.txt file as well to prevent any negative impact on rankings.

问题原文

原帖链接 · spiderling · CC BY-SA 3.0

Do I need to add 301 redirects to the robots.txt file?

I will be adding the redirects to the .htaccess file, but not sure if the search engines need them in the robots.txt file as well to prevent any negative impact on rankings.

已采纳解答

原帖链接 · Evgeniy · CC BY-SA 3.0

To answer your question: no, no any redirection rules in the robots.txt file. Just because it is the wrong place for them. I would highly recommend to read standard specification of robots.txt here and there.

  • Robots.txt is for bots, crawlers, spiders, coming automatically to read and save the content of your pages.

  • Redirection rules are for server, to handle any/all requests, coming from human or software.

There is an approach, called cloacking, which was used by some not-so-white SEOs years ago. This approach is about special setup in the server configuration (like your htaccess) to recognize search engine bots by their user agents and redirect them to special location. According to this the human visitors are redirected to another special locations too.

The goal of this approach was: search engines get pages, which are SEO-optimized in such grade, that they are no longer comfortable to be used by human. Human visitors get served not-so-optimized pages, which however can be offhand used.

By now Google is very good able to recognize and penalize such behavior - cloacking violates Google's ToS.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2018-02-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。