What are the best practices that I can follow to increase the max length of the URL in IIS7/ASP.NET?
Please advise.
The official documentation specifies a maximum length of 2048 characters for the <loc> element, which is used to submit URLs: URL of the page. This URL must begin with the protocol (e.g. “http”) and end with a trailing slash if required by the web server. This value must not exceed 2,048 characters.
Short answer - de facto limit of 2000 characters If you keep URLs under 2000 characters, they'll work in virtually any combination of client and server software.
Although officially there is no limit specified by RFC 2616, many security protocols and recommendations state that maxQueryStrings on a server should be set to a maximum character limit of 1024. While the entire URL, including the querystring, should be set to a max of 2048 characters.
A URL length checker is a tool that allows you to view the number of characters in a URL. By doing this, you can see whether it meets the URL length limit of search engines and make necessary changes for better website optimization. Most search engines allow a max URL text length of 2,000-2,500 characters.
It is generally accepted that URL lengths should not exceed 255 bytes, as older implementations may not be able to accept longer lengths.
From this site: http://technet.microsoft.com/en-us/library/cc754791(v=ws.10).aspx
Use command line : appcmd set config /section:requestfiltering/requestlimits.maxurl: unit
Here is explained how to use appcmd: http://www.windowsnetworking.com/articles_tutorials/Configuring-IIS-7-command-line-Appcmdexe-Part1.html
You need to know where the AppCmd.exe command is located as it is not in the default PATH. In order to run AppCmd.exe, you will either need to change directory into %windir%\system32\inetsrv\ or add that directory to your PATH variable. On my Windows 2008 server with a default installation, AppCmd.exe was located in C:\Windows\System32\inetsrv.
But be careful. If your request url became realy realy large, use post message to pass parameters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With