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