【发布时间】:2012-11-12 22:57:34
【问题描述】:
可能重复:
Is it possible to make an ASP.NET MVC route based on a subdomain?
我的网址看起来像
http://Infosys-1234.teradata.com
我可以通过将路径配置为将整个 URL 作为参数:
routes.MapRoute(
name: "Default",
url: "{url}",
defaults: new { controller = "App",
action = "GetDetailsById",
// url = UrlParameter.Optional
}
);
如果没有,请给我一个替代方案。我想从url中取出Infosys-1234作为参数。
【问题讨论】:
标签: c# asp.net-mvc-4