问题原文
原帖链接 · kg__ · CC BY-SA 4.0
Suppose I have a food blog (say www.myfoodblog.example) with several recipes (mango-icecream, banana-icecream, and berry-icecream). So what I understood for SEO is to have these keywords of recipes in URL. I can have that in two ways:
www.myfoodblog.example/mango-icecream(so I direct user to a new webpage)www.myfoodblog.example#mango-icecream(so I direct user to same webpage but to relevant part).
Which of the two methods is more optimal for SEO?
已采纳解答
原帖链接 · Stephen Ostermiller · CC BY-SA 4.0
URLs with a path are significantly better for SEO.
- Path URLs are server side, fragment URLs are client side.
- Path URLs can serve content that doesn't rely on JavaScript, fragment URLs are typically powered by client side JavaScript (unless they just scroll the page to a particular point.)
- Search engine bots have an easier time crawling path URLs compared with fragment URLs, particularly when the path URL page doesn't require JavaScript to display. Of the major search engine bots, only Googlebot can execute JavaScript. Other search engine bots still can't. Even though Googlebot can execute JavaScript, pages that require JavaScript to show the content often have crawl problems and take Googlebot weeks longer to index.
- If your pages ARE JavaScript powered, path URLs allow you to use pre-rendering to serve a version of the page with less JavaScript reliance. Pre-rendering is not possible with fragment URLs.
- Fragment URLs don't have their own HTTP status. They can't be redirected or retired the way that path URLs can be. It is difficult to deal with URLs that change or go away. They can't return the appropriate "301 moved permanently" or "410 gone status". Instead you have to rely on client side scripting to setLocation to change the URL.
Given the choice between your examlpe URLs I would choose www.myfoodblog.example/mango-icecream for SEO.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
