路由到空白请求使用IIS 6.0 MVC asp.net

编程入门 行业动态 更新时间:2024-10-26 12:26:19
本文介绍了路由到空白请求使用IIS 6.0 MVC asp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图连接到我的网站发表使用下面的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

本文发布于:2023-10-26 01:14:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1528643.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:路由   空白   IIS   asp   MVC

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!