• 【转载】 asp.net网站伪静态化


    第一步:引用一个dll Intelligencia.UrlRewriter.dll(不同的dll可能方法有些不同)

    第二步:在web.config中配置使用伪静态

    <configSections>(在configuration节点下)

                       <section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/></configSections>

    第三步:在web.config中配置url的映射

    <rewrite url="~/index.htm" to="~/index.aspx"/>

    不带参数的例子  url是伪静态的地址  to是实际映射到得地址

    其中带参数的url映射

    <rewrite url="~/demandList-(.+).htm$" to="~/demandList.aspx?firId=$1"/>

    多个参数的话 前面有多个括号 注意 实际映射到得地址多个参数之间是用&amp;分割的相当于&

    如: <rewrite url="~/Quotations-(.+)-(.+).htm$" to="~/Quotations.aspx?id=$1&amp;userId=$2"/>

    这样程序中就已经实现了url伪静态化

    配置iis 使iis支持页面伪静态化

    第一步:右击网站 单机”属性”=》主目录 =》配置 找到扩展名为.aspx的那一行 选中

    点击编辑 复制 可执行文件里面的内容 关闭这个窗口 点击添加  将刚才复制的信息 粘贴到 可执行文件的框中 扩展名写上你要使用的伪静态后缀  如 .htm .html  可以不选”确认文件是否存在”这一复选框 点击确定即可

  • 相关阅读:
    SQL Server 锁升级(Lock Escalations)
    Linux 输入与输出重定向详解
    MySQL DDL的成本高低
    spring 学习-bean创建-refresh方法
    spring 学习-bean创建-scan扫描bean
    spring 学习-bean创建-重要类介绍
    zkclient大量节点事件导致CPU飙升
    spring 学习-bean创建-重要类介绍
    ElasticSearch 按值排序
    Redis set 详解
  • 原文地址:https://www.cnblogs.com/Jhon-xu/p/4312805.html
Copyright © 2020-2023  润新知