即使使用 htaccess 重定向,googlebot 也会索引我的 index.php 吗?
在我的 htaccess 文件中使用重定向语句,在地址栏中输入以下内容的人...
http://example.com/index.php
...将被重定向到...
http://example.com/
我的网站的所有页面上也有一个 noindex、nofollow 元标记。
我的问题是,考虑到重定向行为和元数据,如果我的 robots.txt 文件如下,googlebot 是否会索引我的主页(即 index.php)...
User-agent: Googlebot
Allow: /index.php
Disallow: /
User-agent: *
Disallow: /
如果不是,我应该如何更改我的 robots.txt,以便只有我的主页将被谷歌索引,仅此而已?
提前致谢!
Using a redirect statement in my htaccess file, people who type the following into the address bar...
http://example.com/index.php
...are redirected to...
http://example.com/
I also have a noindex, nofollow meta tag on all my website's pages.
My question is, given that redirect behavior and meta data, will googlebot index my mainpage (i.e. index.php) if my robots.txt file is as follows...
User-agent: Googlebot
Allow: /index.php
Disallow: /
User-agent: *
Disallow: /
If not, how should I change my robots.txt so that only my mainpage will be indexed in google and nothing more?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是有风险的。为了确保 Google 确实为您的主页建立索引,请执行以下操作:
因此您的根“/”将不匹配禁止规则。
另外,如果您有 AdSense,请不要忘记添加
It's risky. To be sure that Google does index your homepage make this:
So your root "/" will not match disallow rules.
Also if you have AdSense don't forget to add