Robots.txt deny, for a #! URL
Robots.txt deny, for a #! URL
我正在尝试添加一个拒绝规则到robots.txt文件,以拒绝访问单个页面。
网站网址的工作方式如下:
- http://example.com/!/首页
- http://example.com/!/关于我们
- http://example.com/!/高度机密
Javascript然后根据URL交换出显示的DIV。
我如何要求搜索引擎蜘蛛不列出以下内容:
- http://example.com/!/高度机密
- http://example.com/index.php !/高度机密
Thanks in advance
你不能(本身)。搜索引擎不会运行JavaScript,所以通常会忽略片段标识符。你只能拒绝从服务器请求的url(没有片段标识符)。
Google会将散列映射到不同的uri上,你可以弄清楚这些是什么(你应该已经做了,因为这是使用散列的重点),并将它们放在 robots.txt中。
散列,然而,最好是有问题的,所以我宁愿放弃它们,而使用历史API,它允许您使用相同的uri。
实际上有多种方法可以做到这一点,但这里有两种最简单的方法。
你必须排除Googlebot将要获取的url,这不是AJAX哈希邦值,而是翻译后的?_escaped_fragment_=key=value
Disallow: /?_escaped_fragment_=/super-secret
Disallow: /index.php?_escaped_fragment_=/super-secret
当你有疑问时,你应该总是使用谷歌网站管理员工具»"Fetch As Googlebot"。
如果页面已经被Googlebot索引,使用robots.txt文件不会将其从索引中删除。你要么必须使用谷歌网站管理员工具URL删除工具后,你应用robots.txt,或者相反,你可以添加一个noindex
命令,通过<meta>
标签或X-Robots-Tag
在HTTP头。
它看起来像:
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
或
X-Robots-Tag: noindex
相关文章:
- Javascript 外部 API 调用,在 for 循环中使用变量 URL
- Javascript Regex Replace for url
- 用于从许多带有“for”循环的URL中获取HTML信息的X射线使对象未定义
- Javascript systax for URL contatenation
- jQuery $.ajax post getting referer url for error debugging
- 如何使用 javascript for http request 使用 .com url.
- JavaScript URL checking for pupunder
- Angularjs regex routes for url
- 无法从 jquery for phonegap 应用程序中的 url 获取 JSON 数据作为文本
- RegEXP matching for web url in javascript
- 将存储在数组中的 url 传递给 window.open in for loop - Javascript
- 优胜美地中的 Javascript for Automation 自定义 URL
- Using Javascript for iFrame src URL
- URL Encoding for PHP
- parsing a url for the id - Javascript
- URL for Raphael.js
- Robots.txt deny, for a #! URL
- Url.Content for javascript
- 类似于对象URL的方式在Chrome for Android中播放本地音频文件
- Setting autorevoke for URL.createObjectURL