Googlebot 会遵循 _escaped_fragment_ HTTP 重定向吗?

发布于 2024-12-01 19:21:58 字数 1519 浏览 0 评论 0 原文

我有一个 ajaxified 网站,我希望我的所有内容都可以抓取。我有一个照片库,它只使用ajax加载照片,而不刷新整个页面。我的根 URL 是这样的:

http://mysite/photos

每当单击照片缩略图时,它都会显示照片,并且哈希变为 #!/photo/photoid/phototitle,或者当您搜索条件时,它变为 #!/photos/f-number/1.8/iso/640例如,用于搜索照片ISO 640 处的 f/1.8(并且可以通过这种方式附加更多标准)。当用户打开诸如 http://mysite/photos/#!/photos/f-number/1.8/iso/640 之类的 URL 登陆页面时,使用 JavaScript,会将用户重定向到 http://mysite/photos/f-number/1.8/iso/640 (没有 hashbang),然后页面再次加载使用ajax的http://mysite/Dynamic/PhotoThumbnails.aspx?f-number=1.8&iso=640(是的,javascript查看位置路径并根据该格式解析它)。对于第一种情况(照片本身的链接而不是搜索),再次仅使用 javascript,页面从 url http:// 加载照片本身(以及一些显示照片技术信息的额外表格) mysite/Dynamic/RenderPhoto.aspx?ID=123(其中 123 是照片的 ID)。

有了这些信息,我的问题很简单:我计划(在我的母版页加载事件上)通过解析 _escaped_fragment_ 将所有带有 _escaped_fragment_ 的请求重定向到适当的 RenderPhoto 或 PhotoThumbnails 页面。代码> 在服务器端。那行得通吗?我主要关心的是;

  • Google 会遵循 HTTP 重定向吗? (301 或 302)
  • 我会因为没有向 Google 显示完全相同的内容而遇到任何麻烦(例如从索引中删除)吗? (浏览器将加载侧导航栏,以及所有那些花哨的 css 样式,视觉上美观的页面等,然后将真实内容加载到该页面的窗格中,Google 将仅在其中获取“真实”内容。我的基本页面、侧边栏内容缩略图列表页面和照片渲染器是完全不同的页面,它们实现了自己的逻辑,因此我无法合并它们)
  • 如果由于上述原因存在被删除的风险,我的替代方案是什么(不,我无法合并页,这不是一个选项)?您是否建议定期拍摄页面快照并缓存它们并将其发送给 Googlebot?

这是我网站的当前测试版(是的,我知道有很多错误),只是为了让您了解它将如何工作: http://canpoyrazoglu.com/photos

我正在使用 ASP.NET 4.0,并使用 jQuery(如果有帮助的话)。

I have an ajaxified website, and I want all my content to be crawlable. I have a photo gallery, which only loads the photo using ajax, without refreshing the whole page. My root URL is this:

http://mysite/photos

and whenever a photo thumbnail is clicked, it displays the photo, and hash becomes #!/photo/photoid/phototitle, or when you are searching for a criteria, it becomes #!/photos/f-number/1.8/iso/640 e.g. for searching for photos with f/1.8 at ISO 640 (and more criteria can be appended this way). When a user opens up a URL like http://mysite/photos/#!/photos/f-number/1.8/iso/640 the landing page, using a javascript, will redirect the user to http://mysite/photos/f-number/1.8/iso/640 (without the hashbang), and again, there, the page loads http://mysite/Dynamic/PhotoThumbnails.aspx?f-number=1.8&iso=640 using ajax (yes, javascript looks at the location path and parses it according to that format). For the first case (link of a photo itself rather than a search), using again, only javascript, the page loads the photo itself (along with some extra tables showing technical info about photo) from the url http://mysite/Dynamic/RenderPhoto.aspx?ID=123 (where 123 the ID of the photo).

Given this information, my problem is simple: I am planning to (on my masterpage load event) redirect all requests with _escaped_fragment_s to the appropriate RenderPhoto or PhotoThumbnails page, by parsing the _escaped_fragment_ at server side. Will that work? My main concerns are;

  • Will Google follow the HTTP redirect? (301 or 302)
  • Will I get into any trouble (such as being removed from index) as I am not showing the exact same content to Google? (a browser will load a side mavigation bar, and all those fancy css styles visually-nice-looking page etc. and then load the real content into a pane at that page, where Google will be getting the "true" content only. My base page, sidebar content thumbnail list page, and photo renderer are COMPLETELY different pages which implement their OWN logic, so I cannot ever merge them)
  • If there is a risk of being removed due to the reasons above, what are my alternatives (no, I cannot merge the pages, it is NOT an option)? Do you recommend taking regular snapshots of pages and cache them and sending those to Googlebot?

Here is the current BETA of my website (yeah I know about lots of bugs), just to give you the idea how it will work: http://canpoyrazoglu.com/photos

I'm on ASP.NET 4.0, and using jQuery, if it helps.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

遥远的绿洲 2024-12-08 19:21:59

是的,我很确定它会遵循重定向。 Facebook 开放图调试器 可以做到这一点,并且这篇博文提倡实现重定向:http://www.yearofmoo.com/2012/11/angularjs-and-seo.html

Yes, I'm pretty sure it will follow a redirect. The Facebook open graph debugger does, and this blog post advocates implementing redirects: http://www.yearofmoo.com/2012/11/angularjs-and-seo.html

撞了怀 2024-12-08 19:21:58

老问题的新答案。是的,它会跟随它。然而,你最终可能会得到 clean 和 #!网址。不过,请查看一下(来自 Google 开发者指南):

请注意,如果您使用永久 (301) 重定向,则我们的 URL 中显示的 URL
搜索结果通常是重定向的目标,而
如果使用临时 (302) 重定向,我们通常会显示 #!网址
在搜索结果中。

这是 Google 开发者指南链接:
https://developers.google.com/webmasters/ajax-crawling/docs /faq#redirects

A new answer to an old question. Yes it will follow it. However you may end up with both the clean and #! URLs. However, check this out (from Google Developer Guides):

Note that if you use a permanent (301) redirect, the url shown in our
search results will typically be the target of the redirect, whereas
if a temporary (302) redirect is used, we'll typically show the #! url
in search results.

This is the Google Developer Guide link:
https://developers.google.com/webmasters/ajax-crawling/docs/faq#redirects

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文