In my ASP MVC site on IIS7.5, and have set a long maxUrlLength
in order to handle urls longer than 260 characters. For this we also have to turn on relaxedUrlToFileSystemMapping
.
So we have this in the web.config:
<httpRuntime enableVersionHeader="false" maxUrlLength="1200"
relaxedUrlToFileSystemMapping="true"
requestPathInvalidCharacters="<,>,&,*,%,:,;,\,?,%" />
A side-efect is that no urls that end with a space and a slash are now valid. e.g. "http://mysite.com/path/to/name /" used to throw a HttpException
that we caught and issued a 301 redirect. But now it does not.
Is it possible to make this url behave as before? Can I specify the space character in the requestPathInvalidCharacters
list somehow? Putting in requestPathInvalidCharacters=" "
has no effect on spaces in urls, and neither does requestPathInvalidCharacters=" ". and requestPathInvalidCharacters="%20"
is a configuration error.