Testing Escaped Fragment Search with Webmaster Tools

孤街浪徒 提交于 2020-01-01 09:59:06

问题


My site is in AngularJS, so I recently created HTML snapshots of all my content, added the escaped fragment tag to the head of all my pages (meta name="fragment" content="!"), and then tried to test to see if the new setup was working in Webmaster Tools. When I look in the source I see the escaped fragment (however, it's inverted) (meta content="!" name="fragment"). I'm not sure why that's happening or if that matters...

When I submit a URL to "Fetch as Google," Webmaster Tools returns Fetch Status Not Found. However, if I manually add "?_escaped_fragment_=" to the end of my URL, I get a success status.

So, my question is, does this have something to do with how Webmaster Tools tests URLs or have I set up fragment escaping incorrectly?


回答1:


Apparently "Fetch as Google" does not fetch the same way that Google does. When using "Fetch as Google" the page isn't checked for the meta tag. However, obviously, Google does check the page for the meta tag when crawling.




回答2:


add a client side "easter egg" keypress that takes the browser's current location and generate the '_escaped_fragment_' form, making sure to escape as needed, and then tell the browser to load that location.

Then to test all you have to do is press your magic key-press and the browser will then redirect to your escaped fragment rendered page.

You can then copy/paste this newly created url into sitemarkup testers, etc.



来源:https://stackoverflow.com/questions/23531687/testing-escaped-fragment-search-with-webmaster-tools

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!