Click here to Skip to main content
16,020,622 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a web application hosted on local IIS with 3 different application aliases (using same physical path) e.g. My application name is XYZ and hosted on IIS as xyz.com, abc.com and 123.com.

In Global.asax I have added code like this.

C#
RouteTable.Routes.Add(
      "RouteName",
      new Route("Route",
      new PageRouteHandler("~/RoutePage.aspx")));

 RouteTable.Routes.Add(
                "DetailRoute",
                new Route("Route/{RouteID}",
                new PageRouteHandler("~/RouteDetailsPage.aspx")));


for URL routing. Its working fine while application runs in debug mode. It shows path like http://localhost:1234/Route and displays RoutePage.aspx
but while browsing through IIS it doesn't work because the url will be http://localhost/abc.com/Route or http://localhost/123.com/Route.

My requirement is that whenever user browse http://localhost[or machine IP]/123.com/Route it should be redirected to Route.aspx.
How to solve this?
Posted

If your intention is to browse Route.aspx, then first add method should be pointing to Route.aspx instead of RoutePage.aspx
 
Share this answer
 
I think the problem fully understand them you want to do the thing, a main top source Domain or machine, or dependent upon access to the A1 at its source, I also want to set up a structure that might as AN'e A2 and so on.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900