Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

500 Internal Server Error IIS7 Encoded url

Tags:

asp.net

iis

iis-7

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.

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.

.../cms/Content/Navigation/LoadTree.ashx?target=preview&selected=%252fhome%252fhelp-and-advice%252f

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.

Investigating this has shown that the above url gives a 500 error.

If i decode the url to

.../cms/Content/Navigation/LoadTree.ashx?target=preview&selected=/home/help-and-advice/

it works with no problems.

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.

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?

EDIT: So this link seems to suggest that its doing this on purpose as a security mesure. http://msdn.microsoft.com/en-us/library/ee656542.aspx

The suggested solution is to upgrade to .net 4.0 and add the following to the web.config

<configuration>
 <uri>
   <schemeSettings>
    <add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/>
   </schemeSettings>
 </uri>
</configuration>

Unfortunately this seems to have no effect.

Any Ideas why this doesnt work?

like image 835
sianabanana Avatar asked Oct 10 '12 10:10

sianabanana


People also ask

How do I fix request failed with status code 500?

Most of the time, the issue is only temporarily and can be corrected by trying the page again. You can use the refresh/reload button, pressing F5 , or by trying the URL again from the address bar. Sometimes this error is caused when a service restarts, and you happen to catch it at exactly the wrong time.

How do I resolve HTTP error 500 in IIS?

IIS error The error 500.19 is an internal server error often occurring on a server using Microsoft IIS software. It indicates that the configuration data for the page is invalid. To solve the issue, delete the malformed XML element from the Web. config file or from the ApplicationHost.

What does the 500 internal server error code mean in IIS website?

HTTP Error 500 message indicates that a problem has occurred on the Web server that hosts the Web site at the time the error is returned.


2 Answers

This could be the URLScan utility. URL Scan blocks URL's based on the rules in it's config file. It also has it's own log file, so you can tell for sure by looking at the URLScan log.

Do a google search for URLSCan default location.

like image 108
Mr Smith Avatar answered Sep 24 '22 20:09

Mr Smith


It seems your url goes through 2 html encode. Is there some url rewriting module active on your IIS7 server ?

like image 21
Vincent Avatar answered Sep 21 '22 20:09

Vincent