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

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

There is a restriction with .Net that cannot handle more than 260 characters . Moreover, if you watch it on the Internet, you will find that IE 6 does not work if it is not fixed at a level above 100 characters.

I want the rewrite path module to be supported on the maximum number of browsers, so I'm looking for an acceptable limit to which I can create detailed URLs.

+6
source share
11 answers

A Url is a path + request, and the related article only talks about path limitation. Therefore, if you use asp.net, do not exceed the path of 260 characters. Less than 260 will always work, and asp.net will not have problems with long retries.

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

Usually the problem is with the browser. A long time ago I did tests and remembered that many browsers support 4k url, with the exception of IE, which limits it to 2083, so for all practical purposes, limit it to 2083. I don’t know if IE7 and 8 have limitations, but if you 'move on to broad compatibility, you need to go for the lowest common denominator.

+5
source share

There are no length limits set by W3C, but look at the practical limits

http://www.boutell.com/newfaq/misc/urllength.html

choose your limit.

+3
source share

The default limit in IIS is 16,384 characters

But IE does not support more than 2083

Additional information on the link

+3
source share

This article describes the restrictions imposed by various browsers. It seems that IE restricts the URL to 2083 characters, so you should probably stay under this if any of your users are in IE.

+2
source share

Define “optimal” for your application.

The HTTP standard has a limitation (it depends on your application):

The HTTP protocol does not place any a priori limit on the length of the URI. Servers MUST be able to process the URIs of any resource they serve, and SHOULD be able to process the URIs of unlimited if they provide GET-based forms that can generate such URIs. the server MUST return 414 (Request-URI Too long) if the URI is longer than the server can process (see section 10.4.15).

  Note: Servers ought to be cautious about depending on URI lengths above 255 bytes, because some older client or proxy implementations might not properly support these lengths. 

So, the question is, what is the limit of your program or what is the maximum size of a resource identifier for your program to perform all its functions?

Your program should have a natural limit.

If this is not the case, you can use it as 16k, since you do not have enough information to determine the problem.

-Adam

+2
source share

Short; -)

The problem is that each web server and each browser have their own ideas about how long this is maximum. The RFC for HTTP does not provide the maximum length. IE restricts access to 2083 characters, the path itself can be no more than 2048 characters. However, this limit is not universal. Firefox claims to support at least 65,536, but some people have confirmed that even some 100,000 characters work on some platforms. Safari exceeds 80,000 (verified). Apache, on the other hand, has a limit of 4000. Microsoft Internet Information Server has one of them 16384 (but it is configurable).

My recommendation is to stay below 2,000 characters anyway. This is not guaranteed to work with every browser in the world (especially not the older one), but it will work with all modern browsers. Further, I recommend using POST wherever possible (for example, to avoid using GET for FORM submits), if some users want to simulate sending FORM via GET, make sure your application supports the desired parameters either through POST or through GET, but when you send the page yourself via a button or JS, prefer POST via GET).

+2
source share

I think the RFC says 4096 characters, but IE truncates to 2083 characters. Be safe to be safe.

Almost shorter URLs are friendlier.

+1
source share

Additional information is needed, but for normal situations, I would say, try to keep it under 150 for sure. If nothing more than pure ascetics, I hate it when someone sends me a GI-NORMOUS link ...

Are you passing values ​​through the query string? I guess that's why you asked, right?

0
source share

What is "optimal"?

GET requests can have a length of several kB, so this is completely subjective.

I would say - stay within the address bar length of the maximally maximized window 1024x768 to be convenient.

0
source share

If you are trying to make people remember the URL, I would not be 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 want the page to be indexed, you could probably go further. Spiders also look for words in the title, and some people are more likely to click on a link if the URL looks readable.

0
source share

When you say “Optimum,” I think, “Easily accessible to users,” in which case, I think, the shorter the URL, the better. In this case, I think the maximum is 20-30 characters.

0
source share

All Articles