简体   繁体   English

Asp.net 4.0中的URL重写不适用于IIS 7

[英]URL Rewriting in Asp.net 4.0 not working on IIS 7

I am doing URL rewriting by registering routes and its working on my local machine(Windows 7). 我正在通过注册路由及其在本地计算机(Windows 7)上的工作来进行URL重写。

But when I deploy the application to a dedicated server(Windows Server 2008 and II7), it says Resource not found when I hit the URL that is mapped to my page. 但是,当我将应用程序部署到专用服务器(Windows Server 2008和II7)时,当我点击映射到我的页面的URL时,显示资源未找到。

Following is the path that is being mapped: 以下是要映射的路径:

routeCollection.MapPageRoute("School", "{pageid}", "~/PublicProfile.aspx");

尝试更改路由,以便在pageId令牌之前有一些内容,例如:

routeCollection.MapPageRoute("School", "PublicProfile/{pageid}", "~/PublicProfile.aspx");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM