能 .(句号)是 URL 路径部分的一部分? [英] Can . (period) be part of the path part of an URL?

查看:47
本文介绍了能 .(句号)是 URL 路径部分的一部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下网址有效吗?

http://www.example.com/module.php/lib/lib.php

根据 http://tools.ietf.org/html/rfc1738 部分的 hpathURL 的元素不能包含."(时期).在上述情况下有一个."根据 RFC1738 不允许的模块"之后.

According to http://tools.ietf.org/html/rfc1738 section the hpath element of an URL can not contain a '.' (period). There is in the above case a '.' after "module" which is not allowed according to RFC1738.

我读错了 RFC 还是这个 RFC 被另一个 RFC 成功了?其他一些 RFC 允许使用 '.'在网址中(http://tools.ietf.org/html/rfc1808).

Am I reading the RFC wrong or is this RFC succeed by another RFC? Some other RFC's allows '.' in URLs (http://tools.ietf.org/html/rfc1808).

推荐答案

我没有看到 RFC1738 在哪里禁止在 URL 中使用句点 (.).以下是其中的一些摘录:

I don't see where RFC1738 disallows periods (.) in URLs. Here are some excerpts from there:

hpath          = hsegment *[ "/" hsegment ]
hsegment       = *[ uchar | ";" | ":" | "@" | "&" | "=" ]
uchar          = unreserved | escape
unreserved     = alpha | digit | safe | extra
safe           = "$" | "-" | "_" | "." | "+"

所以你的问题的答案是:是的,http://www.example.com/module.php/lib/lib.php 是一个有效的 URL.

So the answer to your question is: Yes, http://www.example.com/module.php/lib/lib.php is a valid URL.

这篇关于能 .(句号)是 URL 路径部分的一部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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