What is a safe maximum length a segment in a URL path should be?

前端 未结 3 502
悲&欢浪女
悲&欢浪女 2020-12-01 02:41

A lot of people are asking \"What is the maximum length a URL can be?\" but as far as I can see nobody is asking the question:

3条回答
  •  盖世英雄少女心
    2020-12-01 03:19

    The URL length shouldn't exceed 2K (just common practice). The segment path can be any size.

    The domain length shouldn't be more than 255 characters (see RFC3986). Limits exist only for implementation. Segments attached to URLs are limited only in particular cases (the old common use).

    Nowadays almost all requests go through one file for the rewrite rule, so segment length does not matter. After that, the segment is kept in a variable that can be very large, so there's basically no limit.

提交回复
热议问题