【发布时间】:2014-03-30 14:54:03
【问题描述】:
我刚刚将我的项目框架从 2.0 更改为 4.0,打开 URL 重写页面时出现错误。我有很多东西,但没有一个工作。
请帮助我解决这个问题。
错误:
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Web.config:
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="8.00:00:00" />
</staticContent>
<modules runAllManagedModulesForAllRequests="true">
<remove name="Session" />
<add name="Session" type="System.Web.SessionState.SessionStateModule" preCondition="" />
</modules>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="UrlRoutingHandler" />
</handlers>
<rewrite>
<rules>
<remove name="Plesk. SEO-safe redirect for http://www.theprojectjugaad.com" />
<rule name="Plesk. SEO-safe redirect for http://www.theprojectjugaad.com" enabled="false" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{HTTP_HOST}" pattern="www.theprojectjugaad.com" />
<add input="{HTTPS}" pattern="OFF" />
</conditions>
<serverVariables />
<action type="Redirect" url="http://theprojectjugaad.com/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
【问题讨论】:
-
您访问的是什么 URL(确切地说),以及您希望对其进行哪些重写以使应用程序正常工作?
-
我使用 Global.asax 进行 URL 重写。我正在尝试访问:theprojectjugaad.com/Login/Login.html,如果我使用的是 .aspx,那么它工作正常。
-
我不知道你的文件结构是什么样的,但你的重写规则设置了
enabled="false",所以如果它以前有效,那么重写可能不是问题。 -
是的,工作正常。
-
IIS 错误页面显示它显然正在
D:\Inetpub\vhosts\jeetenparmar.net\theprojectjugaad.com\Login\Login.html中查找 Login.html,但没有找到它。该文件实际在哪里?
标签: asp.net iis url-rewriting