
This is my solution structure.
When users hit in this http://localhost/RouteUrl/ URL I want to redirect them to http://localhost/RouteUrl/UI/MainForm.aspx.
In web.config file within system.web section I’ve written:
<urlMappings enabled="true">
<add url="~/RouteUrl" mappedUrl="~/UI/MainForm.aspx" />
</urlMappings>
And when I browse http://localhost/RouteUrl/ it shows HTTP Error 403.14 – Forbidden. The Web server is configured to not list the contents of this directory
When I directly browse http://localhost/RouteUrl/UI/MainForm.aspx it simply shows the page, doesn’t show any error.
I don’t want to enable directory browsing. What I’m missing? How I should properly redirect the URL?
Finally I find out the problem. The
~itself points to the root directory and in<add />tag I’ve writtenurl="~/RouteUrl".So the corrected
<add />tag will be:<add url="~/" mappedUrl="~/UI/MainForm.aspx" />