What is the optimum limit for URL length? 100, 200+

后端 未结 11 1864
抹茶落季
抹茶落季 2021-01-05 14:17

I have an ASP.Net 3.5 platform and windows 2003 server with all the updates.

There is a limit with .Net that it cannot handle more than 260 characters. Moreover if

相关标签:
11条回答
  • 2021-01-05 15:07

    What is "optimum" anyway?

    GET requests can be several kB in length, so this is entirely subjective.

    I'd say - stay within the address bar length of a maximized 1024x768 window to be user friendly.

    0 讨论(0)
  • 2021-01-05 15:11

    The default limit in IIS is 16,384 characters

    But IE doesn't support more than 2083

    More info at link

    0 讨论(0)
  • 2021-01-05 15:12

    I think the RFC says 4096 chars but IE truncates down to 2083 characters. Stay well under that to be safe.

    Practically, shorter URLs are friendlier.

    0 讨论(0)
  • 2021-01-05 15:13

    A Url is path + querystring, and the linked article only talks about limiting the path. Therefore, if you're using asp.net, don't exceed a path of 260 characters. Less than 260 will always work, and asp.net has no troubles with long querystrings.

    http://somewhere.com/directory/filename.aspx?id=1234
                                                 ^^^^^^^- querystring
                        ^^^^^^^^^^^^^^^^^^^^^^^^ -------- path
    

    Typically the issue is with the browser. Long ago I did tests and recall that many browsers support 4k url's, except for IE which limits it to 2083, so for all practical purposes, limit it to 2083. I don't know if IE7 and 8 have the limitation, but if you're going to broad compatibility, you need to go for the lowest common denominator.

    0 讨论(0)
  • 2021-01-05 15:15

    If you're trying to get people to remember the URL, I wouldn't go more than 60. Use words if possible, because it's easier to remember "www.example.com/this-is-the-url" than "www.example.com/179264". If you're trying to get the page indexed, you could probably go more. The spiders look for words in the title too, and some people may be more likely to click on the link if the URL looks readable.

    0 讨论(0)
提交回复
热议问题