我试图连接到我的网站发表使用下面的URL。 www.mywebsite/ 我不断收到:传入的请求不符合任何路线。这里是我的路由规则:
I'm attempting to connect to my published website using the following url. www.mywebsite/ I keep getting: The incoming request does not match any route. Here are my routing rules:
routes.MapRoute( "Default", // Route name "{controller}.aspx/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); routes.MapRoute( "Default2", // Route name "/", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults );我使用的身份验证这样:
I'm using authentication as such:
<authentication mode="Forms" > <forms loginUrl="~/Home.aspx/Index" protection="All" timeout="300"/> </authentication>当我没有验证它关系到正确的页面,但是当我验证它抛出上述错误。我使用的是IIS 6.0和做整个URL重写解决办法的选择。
When I'm not authenticated it goes to the correct page, but when I am authenticated it throws the above error. I'm using IIS 6.0 and doing the whole rewriting url workaround option.
我是什么失踪?
推荐答案修改/中的默认设置2路线,:
Change "/" in "Default2" route to "":
routes.MapRoute("Default2", "", new { ... });另外,还要确保你已经按照本指南:的 haacked/archive/2008/11/26/asp-mvc-on-iis-6-walkthrough.aspx 为的Default.aspx 文件,如果你是在IIS6。
Also make sure you have followed this guide: haacked/archive/2008/11/26/asp-mvc-on-iis-6-walkthrough.aspx for Default.aspx file if you are on IIS6.
更多推荐
路由到空白请求使用IIS 6.0 MVC asp.net
发布评论