500 error for long url iis7

Posted by Chris Porter on Stack Overflow See other posts from Stack Overflow or by Chris Porter
Published on 2010-05-15T16:38:35Z Indexed on 2010/05/15 16:44 UTC
Read the original article Hit count: 347

Filed under:
|
|
|

I was getting 404 errors for some long URLs on a website I'm developing. After a bit of digging I discovered that this occurs when the length of certain aspects of the URL exceed configurable limits in IIS7. In this case the maxQueryString attribute of the requestLimits property needed to be increased in the web.config

<system.webServer>
<security>
  <requestFiltering>
    <requestLimits maxQueryString="4096" maxAllowedContentLength="4096" maxUrl="8192" >
    </requestLimits>
  </requestFiltering>
</security>

This fixed the problem instantly on my development server but on the remote server I now get:

500 - Internal server error.

There is a problem with the resource you are looking for, and it cannot be displayed.

And that's all the information it gives me.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-mvc