转自:http://www.boutell.com/newfaq/misc/urllength.html
2006-10-13: Although the specification of the HTTP protocol does not specify any maximum length, practical limits are imposed by web browser and server software.
Microsoft Internet Explorer (Browser)
Microsoft states that the maximum length of a URL in Internet Explorer is 2,083 characters, with no more than 2,048 characters in the path portion of the URL. In my tests, attempts to use URLs longer than this produced a clear error message in Internet Explorer.
Firefox (Browser)
After 65,536 characters, the location bar no longer displays the URL in Windows Firefox 1.5.x. However, longer URLs will work. I stopped testing after 100,000 characters.
Safari (Browser)
At least 80,000 characters will work. I stopped testing after 80,000 characters.
Opera (Browser)
At least 190,000 characters will work. I stopped testing after 190,000 characters. Opera 9 for Windows continued to display a fully editable, copyable and pasteable URL in the location bar even at 190,000 characters.
Apache (Server)
My early attempts to measure the maximum URL length in web browsers bumped into a server URL length limit of approximately 4,000 characters, after which Apache produces a "413 Entity Too Large" error. I used the current up to date Apache build found in Red Hat Enterprise Linux 4. The official Apache documentation only mentions an 8,192-byte limit on an individual field in a request.
Microsoft Internet Information Server
The default limit is 16,384 characters (yes, Microsoft's web server accepts longer URLs than Microsoft's web browser). This is configurable.
Perl HTTP::Daemon (Server)
Up to 8,000 bytes will work. Those constructing web application servers with Perl's HTTP::Daemon module will encounter a 16,384 byte limit on the combined size of all HTTP request headers. This does not include POST-method form data, file uploads, etc., but it does include the URL. In practice this resulted in a 413 error when a URL was significantly longer than 8,000 characters. This limitation can be easily removed. Look for all occurrences of 16x1024 inDaemon.pm and replace them with a larger value. Of course, this does increase your exposure to denial of service attacks.
Recommendations
Extremely long URLs are usually a mistake. URLs over 2,000 characters will not work in the most popular web browser. Don't use them if you intend your site to work for the majority of Internet users.
分享到:
相关推荐
A class B network on the internet has a subnet mask of 255.255.240.0, what is the maximum number of hosts per subnet . a. 240 b. 255 c. 4094 d. 65534 2. What is the difference: between o(log n) and ...
(b) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have...
40. What is meant by the ‘value’ of a contract? 188 41. What is calibration? 191 42. What is the market price of risk? 194 43. What is the difference between the equilibrium approach and the no-...
what?is?now?the?open-sourced?NXP?Sensor?Fu- sion?Library.?Stanley?also?wrote?a?series?of?blogs?on?sensor?and?sensor?fusion?topics. As?we?gained?additional?insights?during?the?SenSIP?project,?we?began?...
IBM i - Admin Part 1 - System jobs ...(8) What are the types of Page-fault? (9) What is thrashing? (10) What is JOB activity level in a pool? (11) What is storage pool management in IBM i? How do we ...
What is the State of the Art of Computer Vision-Assisted Cytology A Systematic Literature Review.pdf
Artificial intelligence is a wide field covering diverse techniques, objectives, and measures of success....• What is the best placement of transistors on a chip? • What is the best NBA schedule?
What bugs in the cloud?A Study of 3000+ Issues in Cloud Systems
[16] What is the state of the art in lossless image compression? [17] What is the state of fractal compression? [18] I need specs and source for TIFF and CCITT group 4 Fax. [19] What is JPEG? [20] I ...
1997年在哈佛商业评论上的论文,关于供应链的经典论文,非常有价值
What is Nucleus C++ FILE? Nucleus C++ FILE is a C++ class interface into Nucleus FILE, a FAT16/FAT32 TM compatible file system specifically designed to work in embedded systems in conjunction with the...
The Canterbury Corpus is a benchmark to enable researchers to evaluate lossless compression methods. This site includes test files and compression test results for many research compression methods. ...
What is the capital of EgyptPPT教案学习.pptx
WHAT IS A MATROID? JAMES OXLEY Abstract. Matroids were introduced by Whitney in 1935 to try to capture abstractly the essence of dependence. Whitney’s definition embraces a surprising diversity of ...
2. What is the IP address of gaia.cs.umass.edu? On what port number is it sending and receiving TCP segments for this connection? If you have been able to create your own trace, answer the following...
what is the mindset of funcational programming - chinese edition
"What is the purpose of [something]?" "How does [something] work?" 对比/区别问题: "What are the differences between [A] and [B]?" "How does [A] compare to [B]?" "What distinguishes [A] from [B]?" ...
What’s Inside the CloudAn Architectural Map of the Cloud Landscape
“What bugs live in the cloud? A study of 3000+ issues in cloud system” 论文ppt