我们有一个 MVC 应用程序,可以从两个不同的网站访问。默认网站很好,但是如何设置第二个站点在特定 Controller 中启动?
我们的默认站点是 www.mysite.com
,我们希望为 header www.subdomain.mysite.com
添加第二个 IIS 站点,该站点应该将用户带到 www.subdomain.mysite.com/controller
但是我如何告诉 IIS 使用特定的 Controller 操作 mycontroller
启动 www.mysubdomain.mysite.com
?
最佳答案
我会考虑配置 URL 重写,以便将对 www.mysubdomain.mysite.com
的请求视为对 www.mysubdomain.mysite.com/controller
的请求。
您可以使用Ionics Isapi Rewrite Filter .
Ionic's Isapi Rewrite Filter, aka IIRF, is a small, FREE, easy to use, URL rewriting ISAPI filter. It combines a good price (free!) with good features. It is fast and powerful. It works on IIS 6.0, and later.
关于asp.net-mvc - 如何将 IIS 中的默认页面设置为 Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11413791/