在URL中使用逗号有时会破坏URL吗? [英] Using commas in URL's can break the URL sometimes?

查看:6236
本文介绍了在URL中使用逗号有时会破坏URL吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人知道在SEO友好网址中使用逗号有任何问题?我正在使用一些软件,它在SEO友好的URL中使用了很多逗号;但我100%肯定我已经看到一些程序/平台无法正确识别URL的情况。在第一个逗号后关闭URL的链接。

Is anyone aware of any problems with using commas in SEO friendly URL's? I'm working with some software that uses a lot of commas in it's SEO friendly URL's; but I am 100% certain I have seen some instances where some programs/platforms don't recognize the URL correctly & cut the "linking" of the URL off after the first comma.

我刚用thunderbird,gmail,hotmail&在SMF论坛上没有问题;但是我知道我以前见过这个问题。

I just tested this out with thunderbird, gmail, hotmail & on a SMF forum with no problems; however I know I have seen the issue before.

所以我的问题是,是否有什么特别会导致某些平台停止使用逗号链接URL?比如逗号之后的某个字符?

So my question is, is there anything in particular that would cause some platforms to stop linking URL's with a comma? Such as a certain character after the comma?

推荐答案

将会有无数的实现将会削减此时自动链接。和许多其他角色一样。但这不是问题,因为使用这些字符,但是由于错误/不完整的实现。

There will be countless implementations that will cut the automatical linking at that point. As with many other characters, too. But that’s not a problem because of using these characters, but because of a wrong/incomplete implementation.

请参阅此站点,Stack Overflow。当手动输入/粘贴此URL时,它将切断 * 的链接(查看错误;如果它被修复,这里有一个它的截图):

See for example this very site, Stack Overflow. It will cut off the link at the * when manually entering/pasting this URL (see bug; in case it gets fixed, here’s a screenshot of it):

  • http://wayback.archive.org/web/*/http://www.example.com/

但是当使用超链接语法时,它可以正常工作:

But when using the hyperlink syntax, it works fine:

  • http://wayback.archive.org/web/*/http://www.example.com/

HTTP URL路径中允许使用 * 字符,因此链接检测 应该识别出第一个URL,而不是在出现时将其破坏 *

The * character is allowed in an HTTP URL path, so the link detection should have recognized the first URL instead of breaking it at the occurence of *.

关于逗号:

逗号是保留字符及其含义与URL 路径(大胆强调我的):

The comma is a reserved character and its meaning is relevant for the URL path (bold emphasis mine):


除了分层路径中的点段之外,路径段是泛型语法认为不透明的
。 URI生成应用程序
通常使用段中允许的保留字符来分隔
scheme-specific或dereference-handler-specific子组件。对于
示例,分号(;)和等于(=)保留字符是
,通常用于分隔适用于
该段的参数和参数值。 逗号(,)保留字符通常用于
类似的用途。
例如,一个URI生成器可能使用段
,例如name; v = 1.1表示对
name的版本1.1的引用,而另一个可能使用诸如name,1.1的段到
表示相同。

Aside from dot-segments in hierarchical paths, a path segment is considered opaque by the generic syntax. URI producing applications often use the reserved characters allowed in a segment to delimit scheme-specific or dereference-handler-specific subcomponents. For example, the semicolon (";") and equals ("=") reserved characters are often used to delimit parameters and parameter values applicable to that segment. The comma (",") reserved character is often used for similar purposes. For example, one URI producer might use a segment such as "name;v=1.1" to indicate a reference to version 1.1 of "name", whereas another might use a segment such as "name,1.1" to indicate the same.

因此,如果您不打算将逗号用作保留字符的函数,则可能需要使用%2C <对其进行百分比编码/ code>。从浏览器的地址栏复制此类URL的用户会将其粘贴到编码格式中,因此它几乎可以在任何地方使用。

So, if you don’t intend to use the comma for the function it has as reserved character, you may want to percent-encode it with %2C. Users copying such an URL from their browser’s address bar would paste it in the encoded form, so it should work almost everywhere.

但是,尤其是因为它是一个保留字符,未编码的形式也应该有用。

However, especially because it’s a reserved character, the unencoded form should work, too.

这篇关于在URL中使用逗号有时会破坏URL吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆