”“x2B” 或“-” 作为 URL 中的分隔符?

发布于 2024-07-12 19:52:45 字数 157 浏览 7 评论 0原文

大多数网站使用 - (如 Stack Overflow),但大多数 PHP 框架生成 + 编码的 URL。

那么,什么是 SEO 最好的呢? 使用 +- 作为分隔符?

Most websites use - (like Stack Overflow) but most PHP frameworks generate + encoded URLs.

So, what is the best for SEO? Use + or - as separators?

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

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

发布评论

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

评论(4

夜访吸血鬼 2024-07-19 19:52:45

根据 SEOmoz 在其博客帖子中关于 URL 最佳的说法实践中,最好用连字符分隔,然后是下划线,然后是加号 (+)。

创建包含多个单词的 URL 时
在短语的格式中,连字符是
最好将这些术语分开(例如
/brands/dolce-and-gabbana/),随后
(按顺序)、下划线 (_)、加号
(+) 什么也没有。

according to SEOmoz in one of their blog post regarding URL best practices, hyphens separate best, followed by underscores, and then the pluses (+).

When creating URLs with multiple words
in the format of a phrase, hyphens are
best to separate the terms (e.g.
/brands/dolce-and-gabbana/), followed
(in order) by, underscores (_), pluses
(+) and nothing.

缺⑴份安定 2024-07-19 19:52:45

- 字符用作 永久链接 格式的一部分。 通常,永久链接使用它们代替空格,但仅作为论坛帖子或博客文章标题的一部分。

the - character is used as part of the permalink format. Typically, permalinks use them in place of spaces but only as part of a title for a forum post or blog article.

厌倦 2024-07-19 19:52:45

+- 不相等。

加号是 URI 编码 规范的一部分。 作为保留字符。 特别是,加号用作空格的简写符号查询字符串(搜索“查询字符串”并阅读该标题下方的信息)。

这可能会导致编码问题,其中一个 urlencoding 系统可能使用标准百分比编码,其中另一种方法是使用 RFC 1738 URL 编码。 因此返回的 URL 字符串类型可能不匹配。 因此,您可以对任何以“+”作为重要字符的 URL 进行编码,并对随后的 URL 进行解码。

我建议最好不要使用任何保留字符作为 URL 的关键部分(不要读取查询字符串)并将空格转换为“-”(破折号)。 因为这可能会导致未来不可预测的结果。

我同意它可能不会对 SEO 产生影响......只要页面是可浏览的并且内容(这才是重要的)可以被 SE 索引。

+ and - are not equal.

The plus sign is part of the URI encoding spec. as a reserved character. In particular the plus is used as a shorthand notation for a space in the query string (search for "Query strings" and read the information below that heading).

This may lead to in encoding problem where one urlencoding system may use standard percent encoding, where as another would use RFC 1738 URL encoding. So there could be a missmatch between the type of URL string returned. Thus you would have encode any URL which has a '+' as a significant character, and also decode the ensuing URL.

I would suggest as a best practice to not use any reserved characters as a critical part of your URL (read not the querystring) and convert spaces to '-' (dashes). As it could lead to unpredictable results in the future.

I would agree that it probably won't make a SEO difference... as long as the page is browse-able and the content (which is what matters) is index-able by the SE.

白云不回头 2024-07-19 19:52:45

加号是空格的简化编码(如果未使用 %20,则使用加号,尽管两者同样有效)。 '-' 在 URL 编码中没有特殊含义,将被解码为 '-',其中 '+' 将被解码为空格。

像堆栈溢出这样的网站必须将空格转换为“-”才能生成 URL(而不是对 URL 进行编码)。

有关更多详细信息,请参阅有关 URL 编码的维基百科文章。

哦,直接回答这个问题,对于 SEO 来说,两者都没有好坏之分。

A plus is the simplified encoding for a space (used if %20 is not used, though both are equally valid). The '-' has no special meaning in URL encoding and will be decoded as a '-', where '+' will be decoded to a space.

Sites like stack overflow must be translating spaces to '-' to generate the URL (as opposed to encode the URL).

See the wikipedia article on URL Encoding for more details.

Oh, and to directly answer the question, neither is better or worse for SEO.

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