How to serve multiple domains with a single ASP.NET MVC application?

回眸只為那壹抹淺笑 提交于 2019-12-04 14:59:12
Adrian Grigore

I think you could implement a IRouteConstraint descendant that analyzes the current HttpContext and matches (or does not match) a route depending on the domain requested. Then have two different default routes in your Global.asax file, each with different constraints.

I would still prefer two applications, but it's your choice of course.

Why not set up 2 web applications that share common code in a DLL? Each web app would be a standard MVC application.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!