Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
218 views
in Technique[技术] by (71.8m points)

rfc - Can . (period) be part of the path part of an URL?

Is the following URL valid?

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

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.

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).

question from:https://stackoverflow.com/questions/7555553/can-period-be-part-of-the-path-part-of-an-url

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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           = "$" | "-" | "_" | "." | "+"

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...