0
votes

From an HTTP request with a loooong query string - 2847 in this case -, I got back error 404.15 with the following message:

Überprüfen Sie die Einstellung "configuration/system.webServer/security/requestFiltering/requestLimits@maxQueryString" in der Datei "applicationhost.config" oder "web.config".

In English:

Check the "configuration/system.webServer/security/requestFiltering/requestLimits@maxQueryString" setting in the "applicationhost.config" or "web.config" file.

I did this, by following the documentation and changing the maximum query string length from 2048 to 4096 characters.

Evidently, the above change has had an effect, as the original error message is gone.

Instead, I am now getting another error, still related to the maximum query string length. This time, it comes with HTTP code 400 and says:

Die Länge der Abfragezeichenfolge für die Anforderung überschreitet den konfigurierten maxQueryStringLength-Wert.

In English:

The query string length of the request exceeds the configured maxQueryStringLength value.

Now, I have scanned all *.config files on my entire disks for any occurrences of the substring maxQueryString. There is only one such occurrence in total, and it is the Web.config file for my IIS default website, which says

<requestLimits maxQueryString="4096" />

Hence, something else must be influencing the maximum query length - where else can this setting me configured?

1
Check the event log on the server, it may shed more light. You have to identify which web.config needs to be updated -- and there likely WON'T be a maxQueryStringLength there, and it will need to be created. The entry in the web.config should look something like: <httpRuntime maxRequestLength="2097151" maxUrlLength="2048" maxQueryStringLength="10240" />Brian Clink

1 Answers

0
votes

first, make sure you enabled the anonymous authentication in iis:

set below code in web.config file:

<system.web>

   <httpRuntime maxUrlLength="10999" maxQueryStringLength="2097151" />
                                ……
</system.web>

<system.webServer>
    <security>
    <requestFiltering>
      <requestLimits maxUrl="10999" maxQueryString="2097151" />
    </requestFiltering>
  </security>
</system.webServer>

Note: set value a little bit higher than your requirement. above mentioned is just an example. set this value in the root folder config file. and restart iis after doing changes.