使用特定参数忽略robot.txt 中的网址? [英] Ignore urls in robot.txt with specific parameters?

查看:46
本文介绍了使用特定参数忽略robot.txt 中的网址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望谷歌忽略这样的网址:

I would like for google to ignore urls like this:

http://www.mydomain.com/new-printers?dir=asc&order=price&p=3

所有包含 dir、order 和 price 参数的网址都应该被忽略,但我没有使用 Robots.txt 的经验.

All urls that have the parameters dir, order and price should be ignored but I dont have experience with Robots.txt.

有什么想法吗?

推荐答案

如果您想禁止查询字符串,这里有一个解决方案:

Here's a solutions if you want to disallow query strings:

Disallow: /*?*

或者如果您想更精确地查询您的查询字符串:

or if you want to be more precise on your query string:

Disallow: /*?dir=*&order=*&p=*

您也可以在robots.txt中添加允许访问的url

You can also add to the robots.txt which url to allow

Allow: /new-printer$

$ 将确保只允许使用 /new-printer.

The $ will make sure only the /new-printer will be allowed.

更多信息:

http://code.google.com/web/controlcrawlindex/docs/robots_txt.html

http://sanzon.wordpress.com/2008/04/29/advanced-usage-of-robotstxt-w-querystrings/

这篇关于使用特定参数忽略robot.txt 中的网址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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