谷歌会为 hashbang/escaped_fragment 内容索引正确的 URL

发布于 2024-12-13 01:52:28 字数 497 浏览 7 评论 0原文

我最近阅读了 Google 的使 AJAX 应用程序可抓取,因为我想知道如何正确准备我的动态网站,使用 hashbang 导航来进行 SEO。 我现在明白,对于 mysite.com/#!/foobar,我应该在 mysite.com/?_escaped_fragment_=foobar 提供等效的 html 快照。

我只是想知道谷歌是否将我的页面正确索引为 http://example.com/#!/foobar 或者如果它使用这个 escaped_fragment url?我假设(但想确定)它将正确使用我的 hashbang url 作为搜索结果,但索引内容是从 escaped_fragment 页面获取的。

一些确认会帮助我睡得更好。谢谢

I have recently read Google's Making AJAX Applications Crawlable as I was wondering how to correctly prepare my dynamic site, which uses hashbang navigation, for SEO.
I understand now that for mysite.com/#!/foobar I should serve an equivalent html snapshot at mysite.com/?_escaped_fragment_=foobar.

I just want to know if google then correctly indexes my page as http://example.com/#!/foobar
or if it uses this escaped_fragment url? I'm assuming (but would like to be sure) it will correctly use my hashbang url for the search results but that the indexed content was taken from the escaped_fragment page.

Some confirmation would help me sleep better. thanks

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

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

发布评论

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

评论(1

昨迟人 2024-12-20 01:52:28

默认情况下,谷歌将为您的页面创建 escaped_fragment url。这最终可能看起来很丑。

您应该使用 301 将 escaped_fragment url 重定向到具有更漂亮 url 的页面

假设您的服务器从 googlebot/任何符合 hashbang 的爬虫程序获取 URL 请求,例如“targetPage?_escaped_fragment_=command=play%26id=4ee7af”

您应该让您的 targetPage 接受targetPage?_escaped_fragment_= .... 并创建了一个 301 重定向到自身“targetPage?command=play&id=4ee7af”(或任何其他漂亮的 url,只要它是同一页面)

如果您使用 J2EE,您可以创建一个 servlet 过滤器来拦截并 301 重定向到同一页面的更清晰的 url 。

By default, google will create escaped_fragment url for your page. That could end up looking ugly.

You should redirect escaped_fragment url to a page page with a prettier url using 301

Say your server gets a URL request from googlebot/any hashbang compliant crawler such as "targetPage?_escaped_fragment_=command=play%26id=4ee7af"

You should have your targetPage accepts targetPage?_escaped_fragment_= .... and created a 301 redirect to itself as "targetPage?command=play&id=4ee7af" ( or any other pretty url as long as it is to the same page)

If you were using J2EE you could create a servlet filter to intercept and 301 redirect to cleaner url of the same page.

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