转自: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.
分享到:
相关推荐
(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...
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?
[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 ...
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 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 ...
7. What is the value of DevOps? 8. How does Infosec and QA integrate into a DevOps work stream? 9. My DevOps Favorite Pattern #1 10. My DevOps Favorite Pattern #2 11. My DevOps Favorite Pattern #3
The term business analyst is still synonymous with a career in the IT industry, but the most successful and valuable analysts are those who understand the “business” rather than those who understand...
* 主题、主旨:常见的提问方式、What is the main topic of the conversation?、What are the speakers mainly discussing?、What is the subject of this conversation?、What is the main idea of the ...
The automotive industry is on the verge of undergoing a fundamental transformation. Large, traditional companies in particular will have to adapt, develop new business models and implement ...
The Designer s Guide to High-Purity Oscillators Oscillatory systems exist everywhere, ...questions: ‘what is the precise amplitude of oscillation?’ and ‘what is the exact period of oscillation?’
“Art build upon a science”, strategy is often forgotten by publications dealing with the impacts of technology on warfare, but are network-centric warfare and all those technological artefacts ...
这篇资料是针对2013年九年级英语上册外研版Module 1 Wonders of the World Unit 1 What is a wonder of the world的一次练习,主要涉及词汇、语法、句子翻译以及对话填空等内容。以下是对这些知识点的详细解释: 1....
(a) What is the value of *(p + 3)? 14 (b) What is the value of *(q - 3)? 34 (c) What is the value of q - p? 4 (d) Is the condition p < q true or false? true (e) Is the condition *p *q true or false? ...
“What Is the Internet of Things? The Internet of Things refers to the push to make applications and hardware devices, or “things,” “smart” by receiving or logging data from the Internet and other...
1.6.1 What is a zombie? 1.6.2 How do I prevent them from occuring? 1.7 How do I get my program to act like a daemon? 1.8 How can I look at process in the system like ps does? 1.9 Given a pid, how...
There used to be a time when what is known today as "Information Technology" or IT was less glamorously known as "Electronic Data Processing." And the truth is that for all the buzz about trendy ...
本书详细介绍了数学的各个分支。对于有需要了解数学方法的程序员有很大的帮助。