所有都是按网上的例子来的。但就是出不来我想要的结果,
重写后的地址还是那地址,没变改变过。但是如果手动改成重写后的地址是可以访问的。
代码如下。<configuration>
  <configSections>
    <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
  </configSections>
  <RewriterConfig>
    <Rules>
      <RewriterRule>
        <LookFor>~/Default.html</LookFor>
        <SendTo>~/Default.aspx</SendTo>
      </RewriterRule>
    </Rules>
  </RewriterConfig>
<compilation debug="true"/>
    <httpHandlers>
      <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
      <add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
    </httpHandlers>

解决方案 »

  1.   


    没有出错,原本的地址是:http://localhost:3194/WebSite1/Default.aspx
    重写后的还是这个,按理说应该是http://localhost:3194/WebSite1/Default.html 这个吧
    另外,我在VS2005里写的,IIS映射怎么添加
      

  2.   

    如果我手动的把网址改成http://localhost:3194/WebSite1/Default.html 这个是可以出来的,没有报错。
      

  3.   

    那你已经配置成功了,把需要重写的链接按找你的规则修改成就行了
    比如a.aspx上原来有一个default.aspx的超链接你把他改成default.html就行了
      

  4.   


    原来是这样啊,不是直接访问default.aspx的时候,自动更改成default.html  吗?
      

  5.   

    如果你发布到iis上还需要:
    在IIS的网站上  右键属性->主目录->配置->插入,在弹出的界面中填入[C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll] 或直接点击浏览打开找到这个路径. 同时把[确认文件是否存在]取消勾选.然后重启IIS就OK了.