首页 新闻 会员 周边

我在网上查资料自己写了一个URL REWRITE的网站,在VS里能够运行,在IIS里还是报404错

0
[已解决问题] 解决于 2009-08-12 17:23

我的后缀名为.do,并且在IIS里已经添加映射了:

.do 到C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll

为了在IIS中运行,我还遗漏了哪些步骤吗?

以下是我的WEB.CONFIG:

<?xml version="1.0"?>

<configuration>
  <configSections>
    <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
  </configSections>
    <appSettings/>
    <connectionStrings/>
  <RewriterConfig>
    <Rules>
      <!-- Rules for Blog Content Displayer -->
      <RewriterRule>
        <LookFor>~/(\w+)\.do</LookFor>
        <SendTo>~/$1.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/admin/(\w+)\.do</LookFor>
        <SendTo>~/admin/$1.aspx</SendTo>
      </RewriterRule>
   
  
    </Rules>
  </RewriterConfig>
    <system.web>

    <httpModules>
      <add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter"
/>
    </httpModules>

    <httpHandlers>
        <add verb="*" path="*.do" type="URLRewriter.RewriterFactoryHandler, URLRewriter"
/>
    </httpHandlers>
        <!--
            设置 compilation debug="true" 将调试符号插入
            已编译的页面中。但由于这会
            影响性能,因此只在开发过程中将此值
            设置为 true。
        -->
        <compilation debug="true"/>
        <!--
            通过 <authentication> 节可以配置 ASP.NET 使用的
            安全身份验证模式,
            以标识传入的用户。
        -->
        <authentication mode="Windows"/>
        <!--
            如果在执行请求的过程中出现未处理的错误,
            则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
            开发人员通过该节可以配置
            要显示的 html 错误页
            以代替错误堆栈跟踪。

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
    </system.web>
</configuration>

 

Yuanet的主页 Yuanet | 初学一级 | 园豆:32
提问于:2009-08-12 16:57
< >
分享
最佳答案
0

iis里设置do映射时候不要选检查文件是否存在那个选择框。

第一控制.NET | 小虾三级 |园豆:1245 | 2009-08-12 17:03
恩OK了
Yuanet | 园豆:32 (初学一级) | 2009-08-12 17:23
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册