可以添加多个'?'在网址?

时间:2013-03-23 08:00:09

标签: .htaccess url-rewriting

1 个答案:

答案 0 :(得分:3)

是的,这是可能的。顺便说一下,您修改过的网址只有一个'?'。 从[RFC] [1]指定URI和URL的语法,query是跟随http://www.example.com/pathhttp://www.example.com(路径是可选的)组件的URL的一部分。注意“?” character必须是URL查询部分的第一个字符。

RFC第3.4节中的关键句是

  

字符斜杠(“/”)和问号(“?”)可能代表查询组件中的数据。

以下是RFC管理URI语法的相关部分。

3.4 Query

The query component contains non-hierarchical data that, along with
   data in the path component (Section 3.3), serves to identify a
   resource within the scope of the URI's scheme and naming authority
   (if any).  The query component is indicated by the first question
   mark ("?") character and terminated by a number sign ("#") character
   or by the end of the URI.

      query       = *( pchar / "/" / "?" )

   The characters slash ("/") and question mark ("?") may represent data
   within the query component. Beware that some older, erroneous
   implementations may not handle such data correctly when it is used as
   the base URI for relative references (Section 5.1), apparently
   because they fail to distinguish query data from path data when
   looking for hierarchical separators.  However, as query components
   are often used to carry identifying information in the form of
   "key=value" pairs and one frequently used value is a reference to
   another URI, it is sometimes better for usability to avoid percent-
   encoding those characters.


  [1]: http://tools.ietf.org/html/rfc3986#section-3
相关问题