gpt4 book ai didi

html - MapRequestHandler - 在 IIS 8.0 中从 .aspx 路由 .html 时出现 404.0 错误

转载 作者:太空狗 更新时间:2023-10-29 14:19:03 26 4
gpt4 key购买 nike

我在 Asp.net 框架 4.0 中使用 URL 重写,我正在用 html 扩展名替换 aspx(即我正在使用像 Login.aspx 这样的路由作为 Login.html)。但它显示错误 404 (未找到) 错误。简而言之,带 .html 扩展名的 URL 重写不适用于 IIS 8.0。没有 .html(如带有登录名的 Login.aspx),它工作正常。

检查这个:

请帮我解决这个问题。

Global.asax

void Application_Start(object sender, EventArgs e)
{
RegisterRoutes();
}

private static void RegisterRoutes()
{
System.Web.Routing.RouteTable.Routes.Add(
"Login", new System.Web.Routing.Route("Login.html",
new DisplayRouteHandler("~/Login.aspx")));
}

最佳答案

将应用程序池从经典更改为集成解决了这个问题。

关于html - MapRequestHandler - 在 IIS 8.0 中从 .aspx 路由 .html 时出现 404.0 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33972144/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com