Search code examples
asp.netwebformsurl-routing

Need to route to specific page If I enter URL with path


There are two ASP.NET Web Form App under one domain by using virtual directory EMR and EMRSSO in IIS server:

https://test.xyz.com/emr https://test.xyz.com/emrsso

When I enter URL in browser for https://test.xyz.com/emr, It automatically append "/" in URL and provide expected response. This app is not using URL Routing and using Form Authentication for login.

And when I enter URL in browser for https://test.xyz.com/emrsso, It don't append "/" in URL and does not provide expected response. This app is using URL Routing:

routes.MapPageRoute("Home", String.Empty, ConfigurationManager.AppSettings("HomePage"))

and using Token ID drom third party app for login.

I want that

  1. If I enter URL https://test.xyz.com/emrsso then it should redirect to specific aspx page which i configured in app setting or atleast append "/" in URL.
  2. Why is both behaving differnety in same browser if I am entering same pattern url.

Please help.


Solution

  • I added below to routes and then It worked fine:

    routes.MapPageRoute("Home", "EMRSSO", ConfigurationManager.AppSettings("HomePage"))