- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
各位开发者大家好!
我们即将完成 ajax 网络应用程序第一阶段的开发。在我们的应用程序中,我们使用的哈希片段如下:
http://ourdomain.com/#!list=last_ads&order=date
我知道谷歌会获取这个 url 并以这种形式向服务器发出请求:
http://ourdomain.com/?_escaped_fragment_=list=last_ads?order=date&direction=desc
一切都很完美,除了...
我想将这种请求路由到另一个脚本
像这样:
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
RewriteRule ^$ /webroot/crawler.php$1 [L]
问题是,当我尝试在 crawler.php 中打印_r($_REQUEST) 时,我只得到:
Array
(
[_escaped_fragment_] => list=last_ads?order=date
[direction] => desc
)
我想得到的是
Array
(
[list] => last_ads
[order] => date
[directions] => des
)
我知道我可以使用 php 进一步打破第一个参数,但我不想 ;)
请指教
============================================= =====编辑...对文本和逻辑进行一些更正
最佳答案
你忘记了 QSA 指令(每个人都错过了重点 =D )
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
RewriteRule ^$ /webroot/crawler.php%1 [QSA,L]
顺便说一下,您的 $1
是错误的……没用,因为它没有引用任何内容。所以这应该是:
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
RewriteRule ^$ /webroot/crawler.php [QSA,L]
告诉我这是否有效。
关于php - htaccess 中带有 _escaped_fragment_ 的可抓取 AJAX,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8063287/
我有基于 javascript( Angular )的网站。我还有每个页面的代理页面,这些页面通过 _escaped_fragment_ 参数对谷歌爬虫可见。所有 redirectis 工作正常。我不
我在重写 Apache 时遇到了问题,由于某些原因,上面的第一条规则在没有标志“R”的情况下不工作。 但我想在内部进行重定向。 # FROM http://mysite.ru # TO
我试图让爬虫可以看到我的 meteor 应用程序。我添加了 Spiderable 包并安装了 Phantom.js。当我去 localhost:3000/?_escaped_fragment_= 时,
我使用 React Router 已经有一段时间了,我一直在使用 hashHistory 来处理路由。在某些时候,我打算将应用程序转换到 browserHistory,但我很好奇为什么 Google
Google 发现我允许最终用户使用 ajax 加载来浏览我的内容,并且将我的页面作为用户客户端加载,而不是在新页面加载时请求它们。因此,它不是尝试索引 www.mysite.com/page,而是请
我正在使用 Google App Engine 托管一个带有 Python 网络服务的 AngularJS 应用程序。根路径/设置为返回 index.html,/api/* 请求转到 Python C
我正在努力使基于 AJAX 的网站对 SEO 友好。按照网络教程中的建议,我添加了“漂亮”href链接的属性:контакт并且,在默认情况下使用 AJAX 加载内容的 div 中,用于爬虫的 PHP
我确实将我的网站 (GWT) 设置为可被 Google 抓取。在 Google webmastertool 上使用“fetch as google”页面时,我看到以下模式: 访问“http://www
我正在尝试使用 ajax 来理解 SEO ...我所知道的是我所有的 ajax 链接都必须是(漂亮的 url)格式为 #!anything 的东西因此,当机器人阅读我的页面并找到任何#! url 尝试
各位开发者大家好! 我们即将完成 ajax 网络应用程序第一阶段的开发。在我们的应用程序中,我们使用的哈希片段如下: http://ourdomain.com/#!list=last_ads&orde
我正在尝试在 Facebook 上通过我的应用分享此 URL: http://www.example.com/#!v;id=NH1NlYov3bKJ 但是,它会自动替换为: http://www.ex
假设我有一个带有此 URL 的 AJAX 应用程序:http://www.foo.com/bar#!a=1&b=2&c=3 crawable AJAX会是什么?来自 GoogleBot 的请求是什么样
关于 Google 的 AJAX 抓取规范,如果服务器为 #! 返回一件事(即一个 JavaScript 重的文件)当 #! 发送到 Googlebot 的 URL 和其他内容(即页面的“html 快
我有一个 JavaScript 代码量很大的应用程序,我希望对其进行索引。我的网站上有一个快照目录,可以将其提供给 Google 机器人。这些位于 mysite.com/snapshots/ 下。 我
我正在尝试为我的主干应用程序使用预渲染服务,让我的页面在谷歌上编入索引。 当我专门将 googlebot 添加到用户代理列表时,我知道设置工作正常,但有人建议我不要这样做,而建议使用 _escaped
我的网站目前使用 hashbang URLs 和 Google 弃用的建议,即在使用 _escaped_fragment_ 查询参数请求时提供静态页面。 使用弃用方法的静态预生成页面示例: https
Google 刚刚完成(我现在看到页面刷新在我面前)JavaScript 索引。这很酷,因为我不再需要我所有的工具了。 Google 现在将执行 JavaScript - SEO JavaScript
好的,这就是 Google 所说的 ( https://developers.google.com/webmasters/ajax-crawling/docs/getting-started )。 当
我知道我可以反其道而行之,并让 server.com/#!/mystuff 成为可 ajax 抓取的,但我想知道是否可以反其道而行之。如果我有 server.com/mystuff 并将重定向发送到
如果您使用 hashbang URL,则 /#!/path/to/content ,Facebook 抓取工具(以及 Googlebot)将自动转发至 /?_escaped_fragment_=/pa
我是一名优秀的程序员,十分优秀!