简体   繁体   English

IIS 7的URLRewriter返回404服务器错误

[英]URLRewriter for IIS 7 returns 404 Server Error

I've implemented " Approach 3: Using an HttpModule to Perform Extension-Less URL Rewriting with IIS7 " from here: - http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx 我已经实现了“ 方法3:使用HttpModuleIIS7执行无扩展URL重写 ”: - http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url -rewriting-与-ASP-net.aspx

That is based on URLRewriter module: - http://urlrewriter.net/ 这是基于URLRewriter模块: - http://urlrewriter.net/

It seems to work on my local environment but on production server (running IIS 7) it shows " 404 - File or directory not found " page. 它似乎适用于我的本地环境,但在生产服务器(运行IIS 7)上它显示“ 404 - 文件或目录未找到 ”页面。

I've searched on Google and could not seem to find the solution. 我在Google上搜索过,似乎无法找到解决方案。

In the end, we went back to IIS 6 and followed the instructions here which worked: - http://urlrewriter.net/index.php/support/installation/windows-server-2003 最后,我们回到IIS 6并按照此处的说明进行操作: - http://urlrewriter.net/index.php/support/installation/windows-server-2003

But someday we may have to upgrade to IIS 7 on a shared hosting environment and the same issue will appear again! 但是有一天我们可能不得不在共享托管环境中升级到IIS 7,同样的问题将再次出现!

The hosting dude got it to work in IIS 7. The HTTP handlers requires wildcard mapping with different application pool to make it work in IIS 7. Hope this helps. 托管伙伴让它在IIS 7中工作.HTTP处理程序需要使用不同应用程序池的通配符映射,以使其在IIS 7中工作。希望这会有所帮助。

Make sure you have the following in Web.Config : 确保在Web.Config中包含以下内容:

<system.webServer>
  <validation validateIntegratedModeConfiguration="false"/>
  <handlers>
    <add name="wildcard" path="*" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
  </handlers>
</system.webServer>

I had a similar issue that my page p1 (has been rewritten, originally is p1.aspx) was mistakenly regarded as p1 directory. 我有一个类似的问题,我的页面p1(已被重写,最初是p1.aspx)被错误地视为p1目录。

I added <modules runAllManagedModulesForAllRequests="true" /> to the <system.webServer> in the web.config and it seems begin to work. 我将<modules runAllManagedModulesForAllRequests =“true”/>添加到web.config中的<system.webServer>,它似乎开始工作。

For IIS 7 对于IIS 7

Copy the HttpModules definition in your web.config file from system.web to system.webServer 将web.config文件中的HttpModules定义从system.web复制到system.webServer

<system.webServer>
    <modules>
        <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"/>
    </modules>
<system.webServer>

Application Pools: Managed Pipiline Mode = Integrated 应用程序池:托管Pipiline模式=集成

My colleague had the same problem and I check that he sets the app pool to use the Classic Pipeline instead of using the Integrated Pipeline which he should use and changing this to Integrated solved the problem. 我的同事遇到了同样的问题,我检查他是否将应用程序池设置为使用Classic Pipeline而不是使用他应该使用的Integrated Pipeline,并将其更改为Integrated解决了问题。 Maybe this could solve yours as well? 也许这可以解决你的问题?

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

相关问题 使用IIS 7上传到服务器时,URLRewriter.net发送404,但可在localhost上运行 - URLRewriter.net sends 404 when uploaded to server with IIS 7, but works on localhost iis7上的urlrewriter 404错误使用asp.net和netFramework4.0 - urlrewriter 404 error on iis7 use asp.net and netFramework4.0 IIS 经典模式 .NET Web API 调用返回 4 - IIS Classic Mode .NET Web API Call returns 404 Error URLRewriter可在localhost上运行,但不能在服务器上运行 - URLRewriter works on localhost but not on the server urlrewriter.net可在ASP.NET Web服务器上工作,但不能在IIS 6共享主机上工作 - urlrewriter.net work on ASP.NET web server but not on IIS 6 shared hosting 移至IIS7服务器后出现Signalr 404错误 - Signalr 404 error after moving to iis7 server IIS服务器找不到index.aspx文件-404错误 - IIS server can not find index.aspx file - 404 error IIS 404 详细错误可见。 服务器文件目录暴露 - IIS 404 detailed error visible. Server files directory is exposed Intelligencia UrlRewriter.NET在IIS 6上无法正常工作? - Intelligencia UrlRewriter.NET not working properly on IIS 6? ASMX服务在开发服务器上运行,在部署到IIS 7.5时返回404 - ASMX service works on development server, returns 404 when deployed to IIS 7.5
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM