IIS7 URL Rewrite breaks for URLs containing + characters

Solution 1:

The '+' symbol is really not valid URL encoding for a space. TeamCity should be encoding them as %20.

Either way, the error is probably a result of a common requestFiltering security setting in IIS7.

Try the following command:

%windir%\system32\inetsrv\appcmd set config /section:requestfiltering /allowdoubleescaping:true

It should stop IIS from returing 404's for anything with a + in the URL.

Solution 2:

As h0tw1r3 already answered, you have to disable URL validation.

If you want to do it on IIS server level then use the command below:

%windir%\system32\inetsrv\appcmd set config /section:requestfiltering /allowdoubleescaping:true

If you want to disable it only on application level, then you need to just add the following section to your web.config file:

<system.webServer>
    <security>
        <requestFiltering allowDoubleEscaping="true" />
    </security>
</system.webServer>