Updated web.config so URL rewrite will actually work.

This commit is contained in:
Greg Edwards 2014-09-22 03:23:49 -04:00
parent 6de0ca4055
commit 47e075922e
2 changed files with 6 additions and 2 deletions

View File

@ -41,8 +41,8 @@ namespace Sample
query = url.Substring(q + 1);
}
// Since our handler is not ASP classic, we must rewrite .asp in
// the URL so control will be transferred to it.
// Since our handler is ashx, not ASP classic, we need to rewrite
// the .asp file extension so it will execute.
if (path.Length < 4) return null;
if (path.Substring(path.Length - 4).ToLowerInvariant() != ".asp") return null;
return path.Substring(0, path.Length - 4) + ".ashx";

View File

@ -8,4 +8,8 @@
<compilation debug="true" targetFramework="4.0"/>
<httpRuntime/>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<httpErrors existingResponse="PassThrough"></httpErrors>
</system.webServer>
</configuration>