Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS 7 query string length

I`m using Asp Net Mvc 4 Web Api and I need to make request with querystring length > 2000 symbols

I`ve allready set maxQueryStringLength="10000" parameter in web.config. Everything works well on my developer machine On IIS it works only if querystring < 2000 symbols, but if querystring > 2000 symbols I get an error: 404 Not Found

Any considerations?

like image 892
Vladimir Makhaev Avatar asked Sep 05 '25 03:09

Vladimir Makhaev


1 Answers

Late for the party but, here is the three points we have changed to get rid of it:

In web.config, add httpRuntime tag the attribute maxQueryStringLength:

<system.web>
  <httpRuntime maxQueryStringLength="32768" />
</system.web>

Again in web.config, add requestLimits tag the attribute maxQueryString:

<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxQueryString="32768" />
    </requestFiltering>
  </security>
<system.webServer>

If still no cure, from the IIS config, in ISAPI Filters section, remove the UrlScan filter. This last one did the trick in my case. But, beware, it brings a security risk.

like image 200
vahdet Avatar answered Sep 08 '25 04:09

vahdet