可以“SEO友好”吗? url 包含唯一 ID?

发布于 2024-07-19 06:46:41 字数 463 浏览 8 评论 0 原文

我想开始使用“SEO 友好 URL”,但生成和查找大型、唯一文本“ids”的概念相对于简单地通过整数查找来说似乎是一个重大的性能挑战。 现在,我知道这不是“人类友好”,但如果我从:切换

http://example.com/products/details?id=1000

到:

http://example.com/products/spacelysprokets/sproket/id

我仍然可以单独使用 ID 来快速查找详细信息,但 URL 本身包含将在该详细信息中显示的关键字。 这对谷歌来说足够友好吗? 我希望如此,因为这似乎是一个比最终生成既独特又有意义的东西要容易得多的过程。

谢谢!

I'd like to start using "SEO Friendly Urls" but the notion of generating and looking up large, unique text "ids" seems to be a significant performance challenge relative to simply looking up by an integer. Now, I know this isn't as "human friendly", but if I switched from:

http://example.com/products/details?id=1000

To:

http://example.com/products/spacelysprokets/sproket/id

I could still use the ID alone to quickly lookup the details, but the URL itself contains keywords that will display in that detail. Is that friendly enough for Google? I hope so as it seems a much easier process than generating something at the end that is both unique and meaningful.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(12

小清晰的声音 2024-07-26 06:46:41

小心允许使用与堆栈溢出相同的方法呈现页面。

http://stackoverflow.com/questions/820493/random-text-can-cause-problems

黑帽可能会对长尾竞争对手造成重复内容惩罚(相信我)。

您可以采取以下两项措施来保护自己免受这种情况的影响。

  • HTTP 301 会将与您的 ID 匹配但与文本不匹配的任何入站显示网址重定向到正确的文本。

示例:
http://stackoverflow.com/questions/820493/random-text-can-cause-problems
第301章
http://stackoverflow.com/questions/820493/can-an-seo-Friendly-url-contain-a-unique-id

  • 使用规范 URL。

Be careful with allowing a page to render using the same method as Stack overflow.

http://stackoverflow.com/questions/820493/random-text-can-cause-problems

Black hats can this to cause duplicate content penalty for long tail competitors (trust me).

Here are two things you can do to protect yourself from this.

  • HTTP 301 redirect any inbound display url that matches your ID but doesn't match the text to the correct text.

Example:
http://stackoverflow.com/questions/820493/random-text-can-cause-problems
301 ->
http://stackoverflow.com/questions/820493/can-an-seo-friendly-url-contain-a-unique-id

  • Use canonical URLs.

<link rel="canonical"
href="http://stackoverflow.com/questions/820493/can-an-seo-friendly-url-contain-a-unique-id"
/>

终陌 2024-07-26 06:46:41

查看 StackOverflow 使用的 URL。 他们有一个独特的ID,然后他们有SEO友好的东西。 您可以省略 SEO 友好的内容,并且 URL 仍然有效。

Have a look at the URLs that StackOverflow uses. They have a unique id, then they have the SEO-friendly stuff. You can omit the SEO-friendly stuff and the URL still works.

潇烟暮雨 2024-07-26 06:46:41

你在这里大肆讨价还价,你正在用商业目标换取技术目标。

如果您问“从纯粹的商业和SEO角度来看,在URL中包含唯一ID是否更好?”; 答案显然是不使用它们。

那么问题就变成了,如果你确实使用它们,它会对你在搜索引擎中造成多大的伤害? 答案是肯定会产生一些负面影响。 多少尚未确定。

就“用户友好”而言,不,它们绝对不用户友好。

就 Google 而言,他们表示“只要有可能,通过修剪不必要的参数来缩短 URL”。 请参阅他们的网址结构文档。

You are making a devils bargan here, you are trading away business goals for technology goals.

If you were to ask "From a purely business and SEO prospective, is it better to include unique IDs in the URL or not?"; the answer would clearly be to not use them.

The question then becomes, if you do use them, how much does it hurt you in the search engines? The answer is that it definately has some negative impact. How much is yet to be determined.

In terms of "user friendly", no, they are definitely not user friendly.

In terms of Google, they state "Whenever possible, shorten URLs by trimming unnecessary parameters." See their URL structure document.

会傲 2024-07-26 06:46:41

我不知道向 URL 添加 ID 会导致任何问题。 事实上,它非常有用,因为它允许更改 URL 的人类/搜索引擎友好部分,而不会导致指向搜索引擎已索引的页面的链接损坏。 以SO为例,这里是您的问题的链接:

https://stackoverflow.com/questions/820493/you-can-put-any-text-you-want-here

I'm not aware of any problems caused by adding an ID to a URL. In fact it can be extremely useful, as it allows the human/search engine friendly part of the URL to be changed without causing a broken link to a page that a search engine has already indexed. Using SO as an example, here's a link to your question:

https://stackoverflow.com/questions/820493/you-can-put-any-text-you-want-here

笑饮青盏花 2024-07-26 06:46:41

没有错。 越来越多的服务已开始使用混合解决方案,例如 保罗·汤布林已经指出。 除了 SO 之外,Tumblr 也使用这种模式(也许这是第一个)。

此外,在某些服务中,例如 Google 新闻< /a> — URL 必须包含唯一的数字 ID。

Nothing wrong with that. An increasing number of services have started to use a hybrid solution as Paul Tomblin already pointed out. In addition to SO, Tumblr uses this pattern too (maybe it was the first).

Furthermore, in certain services—like Google News—the URL must contain a unique numeric ID.

听不够的曲调 2024-07-26 06:46:41

摆脱参数化 URL 肯定会有帮助。 根据我的经验,只要 url 中没有“?key=value”对,包含 ID 就不会造成伤害或帮助。

Getting rid of the parameterized URL will definitely help. From my experience, including the ID does not hurt or help, as long as there are no '?key=value' pairs in the url.

梦初启 2024-07-26 06:46:41

我在这里要提出两个看似矛盾的观点:-

  1. 没有人看 URL! 经验已经“训练”浏览器用户将“地址”框内容呈现为不可见,他们知道这些内容将是“不可读”、“无意义”和“令人困惑”中的任意两个,因此他们完全忽略它。

  2. 与使用较长的字符串(hash() 与 to_int() )转换为整数相比,使用可以轻松转换为整数的字符串可能会提供轻微的性能优势。 然而,在普通 Web 应用程序的上下文中,任何性能差异都可以忽略不计。

我的建议是坚持你觉得舒服的事情。

I have two seemingly contradictory points to make here:-

  1. Nobody looks at URLs! Experience has "trained" browser users to render the "Address" box contents as invisable, they know the contents will be any two of 'ureadable', 'meaningless' and 'confusing', hence they just ignore it completely.

  2. Using a String which can be easily converted to an integer may offer a slight performance advantage over using a longer string which is slightly harder (hash() vs. to_int() ) to convert into an integer. However in the context of the average web application any performance difference would would be negligable.

My advice would be to stick with what your comfortable with.

み青杉依旧 2024-07-26 06:46:41

使用 modrewrite 之类的东西在 URL 到达您的服务器之前对其进行解析。 因此,您可以转换像 http://oorl.com/ 99942/My-Friendly-Text-For-Search-Engines/ 进入 http:// /oorl.com/lookup.php?id=99942。 这还可以让您更改用于优化某些链接的别名和关键字,而不会损坏功能。

Use something like modrewrite to parse URLs before they reach your server. So you could convert a slug like http://oorl.com/99942/My-Friendly-Text-For-Search-Engines/ into http://oorl.com/lookup.php?id=99942. This will also let you change slug and keywords used to optimize certain links without damaging functionality.

椒妓 2024-07-26 06:46:41

与友好的 URL 相比,重复引用会造成更多负面影响,请小心使用带 id 的虚假文本,您的竞争对手可能会错过使用此功能。

Duplicate refer cause more negative impact compare to friendly URL, be careful about using fake text with id, your competitors could miss use this.

噩梦成真你也成魔 2024-07-26 06:46:41

根据 slug 的短网址是 seo 友好的"nofollow noreferrer">什么是 slug 以及如何优化它?

而且,下面带有 slugid 的示例 url 足够 seo 友好。 *如果网址没有 id,它对 seo 更友好,因为它更短,但我知道 id 对于查找对象确实很有用,所以没问题:

                 # ↓ "slug" ↓
http://myshop.com/orange-juice/id
                         # "id" ↑

A short url with slug is seo-friendly according to What is a slug and how to optimize it?.

And, the example url with slug and id below is seo-friendly enough. *If the url doesn't have id, it's more seo-friendly because it's shorter but I know that id is really useful to look up an object so no problem:

                 # ↓ "slug" ↓
http://myshop.com/orange-juice/id
                         # "id" ↑
一紙繁鸢 2024-07-26 06:46:41

是的,事实上,在您的网址中包含一个数字对SEO更友好,因为这向谷歌暗示您正在不断更新您的内容。

我相当肯定,如果您的网址没有以某种方式附加递增的数字,那么在 Google 新闻中编入索引就会变得更加困难。

Yes, and in fact it's more SEO friendly to include a number in your url as it implies to google that you are consistently updating your content.

I am fairly sure that it makes it much more difficult to get indexed in Google News if you don't have an incrementing number attached in some way to your URLs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文