I have problems with URLs exceeding 260 characters in
ASP.NET MVC 4.0
Umbraco CMS
Azure Websites
IIS chokes and throws the following error:
Bad Request - Invalid URL
HTTP Error 400. The request URL is invalid.
Example URL:
http://example.com/article/123/some-headline-longer-than-260-characters-with-only-text-and-numbers-used
In my case, the URL is 303 characters long without any querystring. Shortening the URL to 260 chars resolve the problem but for me it is not a viable solution. Since I am using ASP.NET I added the following to web.config
- however, the problem remain even with maxUrlLength="1024"
:
<?xml version="1.0"?>
<configuration>
<system.web>
<httpRuntime
requestValidationMode="4.0"
requestPathInvalidCharacters="<,>"
maxUrlLength="1024"
maxQueryStringLength="768"
relaxedUrlToFileSystemMapping="true" />
</system.web>
</configuration>
Additional info: All my URLs are kept below the 2000-ish limit (cf. What is the maximum length of a URL in different browsers?)
Any ideas?
You may need to extend the limit in the registry: http://support.microsoft.com/kb/820129
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