title: 500 Internal Server Error IIS7 Encoded url
body: <p>Im using N2Cms and am looking in to some issues i have with it.  It has a navigation panel on the left hand side that loads via ajax as you expand the tree.</p>
  
  <p>The code that gets the childeren of the node calls an ashx file with some parameters.  One parameter is for a path and contains slashes in it.  For this reason it has been encoded.</p>
  
  <pre><code>.../cms/Content/Navigation/LoadTree.ashx?target=preview&amp;selected=%252fhome%252fhelp-and-advice%252f
  </code></pre>
  
  <p>I have had no issues with this on my development server (running iis 7.5) but when deployed to our test server (iis7) the navigation fails to work.</p>
  
  <p>Investigating this has shown that the above url gives a 500 error.</p>
  
  <p>If i decode the url to </p>
  
  <pre><code>.../cms/Content/Navigation/LoadTree.ashx?target=preview&amp;selected=/home/help-and-advice/
  </code></pre>
  
  <p>it works with no problems.</p>
  
  <p>Unfortunately i cannot change the code that generates this as its a part of the n2cms source code and i am assuming it has been encoded for a good reason.</p>
  
  <p>Does anyone know anything i can do either in my web.config to allow encoded parameters or something i can change on the iis server?</p>
  
  <p><strong>EDIT:</strong>
  So this link seems to suggest that its doing this on purpose as a security mesure.
  <a href="http://msdn.microsoft.com/en-us/library/ee656542.aspx">http://msdn.microsoft.com/en-us/library/ee656542.aspx</a></p>
  
  <p>The suggested solution is to upgrade to .net 4.0 and add the following to the web.config</p>
  
  <pre><code>&lt;configuration&gt;
   &lt;uri&gt;
     &lt;schemeSettings&gt;
      &lt;add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/&gt;
     &lt;/schemeSettings&gt;
   &lt;/uri&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Unfortunately this seems to have no effect.</p>
  
  <p>Any Ideas why this doesnt work? </p>