开发者

With Google's #! mess, what effect would a redirect on the converted URL have?

So Google takes:

http://www.mysite.com/mypage开发者_运维问答/#!pageState

and converts it to:

http://www.mysite.com/mypage/?_escaped_fragment_=pageState

...So... Would be it fair game to redirect that with a 301 status to something like:

http://www.mysite.com/mypage/pagestate/

and then return an HTML snapshot?

My thought is if you have an existing html structure, and you just want to add ajax as a progressive enhancement, this would be a fair way to do it, if Google just skipped over _escaped_fragment_ and indexed the redirected URL. Then your ajax links are configured by javascript, and underneath them are the regular links that go to your regular site structure.

So then when a user comes in on a static url (ie http://www.mysite.com/mypage/pagestate/ ), the first link he clicks takes him to the ajax interface if he has javascript, then it's all ajax.

On a side note does anyone know if Yahoo/MSN onboard with this 'spec' (loosely used)? I can't seem to find anything that says for sure.


If you redirect the "?_escaped_fragment_" URL it will likely result in the final URL being indexed (which might result in a suboptimal user experience, depending on how you have your site setup). There might be a reason to do it like that, but it's hard to say in general.

As far as I know, other search engines are not yet following the AJAX-crawling proposal.


You've pretty much got it. I recently did some tests and experimented with sites like Twitter (which uses #!) to see how they handle this. From what I can tell they handle it like you're describing.

If this is your primary URL

 http://www.mysite.com/mypage/#!pageState

Google/Facebook will go to

 http://www.mysite.com/mypage/?_escaped_fragment_=pageState

You can setup a server-side 301 redirect to a prettier URL, perhaps something like

 http://www.mysite.com/mypage/pagestate/

On these HTML snapshot pages you can add a client-side redirect to send most people back to the dynamic version of the page. This ensures most people share the dynamic URL. For example, if you try to go to http://twitter.com/brettdewoody it'll redirect you to the dynamic (https://twitter.com/#!/brettdewoody) version of the page.

To answer your last question, both Google and Facebook use the _escaped_fragment_ method right now.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜