【发布时间】:2011-04-05 16:09:17
【问题描述】:
我正在尝试在我的项目中启用重写的 url。 这篇文章中描述的非常好:urlrewriting by scottgu 当我在 localhost 上运行它时效果很好,但是一旦我将它上传到我的主机(.net 3.5),它就不起作用了!我总是被重定向到 404 页面!
是否需要进行配置才能启用此功能? 正如 scottgu 所说,不,但我不知道为什么它不起作用......
谢谢
// 更新 2.09.2010
实际上有没有一种方法可以在没有 iis7 或在服务器上安装诸如 ISAPI Rewrite 之类的模块的情况下启用路由或重写? 看起来我的 asp.net 主机不好...
【问题讨论】:
-
您是否尝试过在 Application_BeginRequest 中查看您的 url 是如何重写的?
-
你的 IIS 版本是多少?
-
我怎么能看到这个?我使用这种方法: void Application_BeginRequest(object sender, EventArgs e) { string fullOrigionalpath = Request.Url.ToString(); if (fullOrigionalpath.Contains("/Products/Books.aspx")) { Context.RewritePath("/Products.aspx?Category=Books"); } .... }
标签: asp.net configuration url-rewriting