IIS6中.net项目伪静态重写路径的配置方法

5 篇文章 0 订阅

1、右键点击 要设置网站的网站

2、属性 ——》主目录 ——》配置——》

3、如右侧窗口,找到 .aspx 扩展名——》编辑——》复制 可执行文件的路径——》关闭 

4、点击 添加——》粘贴 刚复制的 可执行文件路径 

5、扩展名填写 .html (如果是 .htm 或者 任意你想要的扩展都可以 前提是以后的应用程序扩展列表里边没有该扩展)

6、不选中 确认文件是否存在 

7、确定

iis6 web.config 伪静态配置方法

1、参数用()括起来,使用 $1 来获得参数。

2、多个参数的时候使用&分割。

3、把Intelligencia.UrlRewriter.dll添加到bin目录

<span class="sh_preproc" style="color: rgb(160, 32, 240);"><?xml</span> <span class="sh_type" style="color: rgb(0, 0, 255);">version</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"1.0"</span><span class="sh_preproc" style="color: rgb(160, 32, 240);">?></span>

<span class="sh_keyword" style="color: rgb(165, 42, 42);"><configuration></span>

    <span class="sh_keyword" style="color: rgb(165, 42, 42);"><configSections></span>
        <span class="sh_keyword" style="color: rgb(165, 42, 42);"><section</span> <span class="sh_type" style="color: rgb(0, 0, 255);">name</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"rewriter"</span> <span class="sh_type" style="color: rgb(0, 0, 255);">requirePermission</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"false"</span> <span class="sh_type" style="color: rgb(0, 0, 255);">type</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"</span><span class="sh_keyword" style="color: rgb(165, 42, 42);">/></span>
    <span class="sh_keyword" style="color: rgb(165, 42, 42);"></configSections></span>
    <span class="sh_keyword" style="color: rgb(165, 42, 42);"><system.web></span>
        <span class="sh_keyword" style="color: rgb(165, 42, 42);"><httpModules></span>
            <span class="sh_keyword" style="color: rgb(165, 42, 42);"><add</span> <span class="sh_type" style="color: rgb(0, 0, 255);">type</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"</span> <span class="sh_type" style="color: rgb(0, 0, 255);">name</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"UrlRewriter"</span><span class="sh_keyword" style="color: rgb(165, 42, 42);">/></span>
         <span class="sh_keyword" style="color: rgb(165, 42, 42);"></httpModules></span>
    <span class="sh_keyword" style="color: rgb(165, 42, 42);"></system.web></span>
    <span class="sh_keyword" style="color: rgb(165, 42, 42);"><rewriter></span>
        <span class="sh_comment" style="color: rgb(255, 0, 0);"><!--首页--></span>
        <span class="sh_keyword" style="color: rgb(165, 42, 42);"><rewrite</span> <span class="sh_type" style="color: rgb(0, 0, 255);">url</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"~/default.html$"</span> <span class="sh_type" style="color: rgb(0, 0, 255);">to</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"~/default.aspx"</span> <span class="sh_type" style="color: rgb(0, 0, 255);">processing</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"stop"</span><span class="sh_keyword" style="color: rgb(165, 42, 42);">/></span>
        <span class="sh_comment" style="color: rgb(255, 0, 0);"><!--新闻--></span>
        <span class="sh_keyword" style="color: rgb(165, 42, 42);"><rewrite</span> <span class="sh_type" style="color: rgb(0, 0, 255);">url</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"~/news/list-([A-Za-z0-9-]*).html$"</span> <span class="sh_type" style="color: rgb(0, 0, 255);">to</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"~/NewsList.aspx?typeUrl=$1"</span> <span class="sh_type" style="color: rgb(0, 0, 255);">processing</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"stop"</span><span class="sh_keyword" style="color: rgb(165, 42, 42);">/></span>
        <span class="sh_keyword" style="color: rgb(165, 42, 42);"><rewrite</span> <span class="sh_type" style="color: rgb(0, 0, 255);">url</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"~/news/list-([A-Za-z0-9-]*)-([0-9]*).html$"</span> <span class="sh_type" style="color: rgb(0, 0, 255);">to</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"~/NewsList.aspx?typeUrl=$1&page=$2"</span> <span class="sh_type" style="color: rgb(0, 0, 255);">processing</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"stop"</span><span class="sh_keyword" style="color: rgb(165, 42, 42);">/></span>
        <span class="sh_comment" style="color: rgb(255, 0, 0);"><!--新闻详细--></span>
        <span class="sh_keyword" style="color: rgb(165, 42, 42);"><rewrite</span> <span class="sh_type" style="color: rgb(0, 0, 255);">url</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"~/news/([A-Za-z0-9-]*).html$"</span> <span class="sh_type" style="color: rgb(0, 0, 255);">to</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"~/NewsDetail.aspx?url=$1"</span> <span class="sh_type" style="color: rgb(0, 0, 255);">processing</span><span class="sh_symbol">=</span><span class="sh_string" style="color: rgb(255, 0, 255);">"stop"</span><span class="sh_keyword" style="color: rgb(165, 42, 42);">/></span>
    <span class="sh_keyword" style="color: rgb(165, 42, 42);"></rewriter></span>
<span class="sh_keyword" style="color: rgb(165, 42, 42);"></configuration></span>

大功告成。自认为写的很详细。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值