开发者

Problem with httpContext.RewritePath on IIS 7

开发者 https://www.devze.com 2023-02-09 22:06 出处:网络
I am using HttpContext.RewritePath in Global.asax for some URL rewriting, and it works very well in my development environment on the Cassini server. But when I copy it to the production server runnin

I am using HttpContext.RewritePath in Global.asax for some URL rewriting, and it works very well in my development environment on the Cassini server. But when I copy it to the production server running IIS 7, it isn't working. I have also tried to use Context.Server.TransferRequest but then I get the error: "This operati开发者_如何学Pythonon requires IIS integrated pipeline mode." on both Cassini and IIS 7 (on IIS 7 the website is running in "Integrated" mode in the AppPool).

I rewrite all URLs on the website like /[The main menuname]/[pagename].aspx e.g. from /web/thesite.aspx?mainmenu=manager to /manager/thesite.aspx OR /web/theOtherSite.aspx?mainmenu=about to /about/theOtherSite.aspx, and so on...


I found out that i need to add the following to web.config

 <configuration>
<system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
</system.webServer></configuration>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号