为什么有些网站会添加“Slugs"?到 URL 的末尾? [英] Why do some websites add "Slugs" to the end of URLs?
问题描述
许多网站,包括这个网站,都在 URL 末尾添加了明显称为 slugs 的内容 - 描述性但据我所知是无用的文本部分.
Many websites, including this one, add what are apparently called slugs - descriptive but as far as I can tell useless bits of text - to the end of URLs.
例如,网站为这个问题提供的 URL 是:
For example, the URL the site gives for this question is:
https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls
但以下 URL 也同样有效:
But the following URL works just as well:
https://stackoverflow.com/questions/47427/
这段文字的目的仅仅是为了让 URL 对用户更友好还是有其他一些好处?
Is the point of this text just to somehow make the URL more user friendly or are there some other benefits?
推荐答案
slugs 使 URL 更加用户友好,并且您知道单击链接时会发生什么.如果搜索词在 URL 中,搜索引擎(例如 Google)对页面的排名更高.
The slugs make the URL more user-friendly and you know what to expect when you click a link. Search engines such as Google, rank the pages higher if the searchword is in the URL.
这篇关于为什么有些网站会添加“Slugs"?到 URL 的末尾?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!