First, I was trying to build a POC for a URL Mapping feature in .net 2.0.
So, I had the below config in the web.config.
<urlmappings enabled="true">
<add url="~/application/action/view/test" mappedurl="~/app/navigate.ashx?action=view&module=test">
<add url="~/application/enroll" mappedurl="~/default.aspx?action=enroll">
<add url="~/application/register" mappedurl="~/app/navigate.ashx?action=register">
</urlmappings>
The above stuff worked beautifully when I ran from the VS.Net 2005 editor. The application was running in the Web Dev server. For "
http://localhost:2401/application/enroll
" it mapped the request to default.aspx. I moved the application to IIS 6.0. Booomm!!! I get 404 error with the http://localhost/urlmapping/application/enroll. Makes sense, because when I try http://localhost:2401/application/enroll, IIS tries to find the default document - ah now IIS could not find any default document, it throws 404 exception.
<urlmappings enabled="true">
<add url="~/application/enroll/<anything>.aspx" mappedurl="~/default.aspx?action=enroll">
When above change was made, it worked fine because, IIS has no roll to play except to hand over the request to ASP.Net engine. Once it comes to asp.net environment we have complete control. So it was important to keep proper environment for POC. As you all know Web Dev server runs with a higher privilege that IIS might actually run and this would also cause problem.
In my case it was not that costly but otherwise we should give due respect to the POC environment.
0 comments:
Post a Comment