为什么只是 URL 路径中的 ID 对 SEO 来说是个坏主意? [英] Why is just an ID in the URL path a bad idea for SEO?
问题描述
为什么在 SEO 方面在 URL 中包含 ID 是个坏主意?这个网址如何http://example.com/user/1234
伤害了 SEO?
Why is it a bad idea to have a ID in the URL in terms of SEO? How does this URL
http://example.com/user/1234
hurt SEO?
谁能给我一个搜索引擎排名更差的实际例子?
Can someone give me a practical example where search engine rankings are worse?
推荐答案
人们说 URL 中的 {ID} 不好的原因是搜索引擎算法的工作方式.当搜索词位于实际 URL 中时,它的权重比页面内容等要重得多.
The reason people are saying that {ID} in the URL is bad is due to the way search engine algorithms work. When a search term is located in the actual URL, it is weighted much more heavily than the content of the page, etc.
例如:
<!-- http://example.com/blog/57 -->
<html><head><title>An article on search engine optimization</title>...
对比
<!-- http://example.com/blog/an-article-on-search-engine-optimization -->
<html><head><title>An article on search engine optimization</title>...
如果您在 Google 中搜索第二页的搜索引擎优化",那么在 url 中带有 slug 的页面的权重会比只有 id 的页面要好.
If you do a search in Google for "Search Engine Optimization" the second page, the one with the slug in the url will weight as a better result than the one with only the id.
您可以按照堆栈溢出处理此问题的相同方式处理此问题:
You can deal with this in the same way that stack overflow deals with this issue:
http://stackoverflow.com/questions/{id}/{slug}
http://stackoverflow.com/questions/910683/why-is-id-in-the-url-a-bad-idea
组合 id 和 slug 格式确实可以帮助您实现两全其美.您可以通过按 {id} 检索记录来轻松编程,但由于 {slug},您还保留了优化的搜索 URL.
The combined id and slug format really helps you achieve the best of both worlds. You get the ease of programming by retrieving records by {id}, but you also retain the optimized search URL because of the {slug}.
这篇关于为什么只是 URL 路径中的 ID 对 SEO 来说是个坏主意?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!