Asp.net Url重写器可以在本地主机上工作,但不能在生产服务器上工作
我已经让URLRewriter在我的localhot上完美地工作了,但是在生产中我得到了404个错误 我使用的是IIS 6,从我所读到的来看,这应该可以正常工作 以下是我的web.config中的内容:Asp.net Url重写器可以在本地主机上工作,但不能在生产服务器上工作,asp.net,iis-6,urlrewriter.net,Asp.net,Iis 6,Urlrewriter.net,我已经让URLRewriter在我的localhot上完美地工作了,但是在生产中我得到了404个错误 我使用的是IIS 6,从我所读到的来看,这应该可以正常工作 以下是我的web.config中的内容: <rewriter> <rewrite url="~/(\d+)$" to="~/Items/Details.aspx?ItemId=$1" /> <rewrite url="~/Items/(\d+)$" to="~/Items/Details
<rewriter>
<rewrite url="~/(\d+)$" to="~/Items/Details.aspx?ItemId=$1" />
<rewrite url="~/Items/(\d+)$" to="~/Items/Details.aspx?ItemIId=$1" />
</rewriter>
<section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"/>
</httpModules>
有没有人遇到过类似的问题并解决了
谢谢
<rewrite url="~/Items/(\d+)$" to="~/Items/Details.aspx?ItemIdId=$1" />
GET参数是指ItemId吗?因为现在它是itemidd
希望这有帮助。这是因为您需要在生产服务器上设置通配符映射。IIS6只运行某些文件格式,如.aspx等,但不将无扩展URL映射到asp.net管道 本教程将回答您的问题:
注意:您需要对服务器进行远程桌面访问,因此在共享主机环境中这是不可能的,除非您的主机愿意代表您进行设置。不,就像我说的,只是一个输入错误,在本地主机上有效,而不是在产品上。您确定在生产服务器上正确安装了UrlRewriter DLL吗?您是否在Windows事件日志中看到任何错误?是否已安装?它放在垃圾箱里。什么安装?哎呀,才意识到这个问题有一年了…:P