0
可能重複:
Is it possible to make an ASP.NET MVC route based on a subdomain?以整個URL作爲參數MVC 4.0
我的URL看起來像
http://Infosys-1234.teradata.com
我可以把整個URL作爲一個參數配置我的路徑爲:
routes.MapRoute(
name: "Default",
url: "{url}",
defaults: new { controller = "App",
action = "GetDetailsById",
// url = UrlParameter.Optional
}
);
如果沒有,建議我一個替代方案。我想從網址中取出Infosys-1234作爲參數。
的http:// blog.maartenballiauw.be/post/2009/05/20/ASPNET-MVC-Domain-Routing.aspx – spender