欢迎加入站点基地设计开发交流群:30720409
详细内容
.net网站做伪静态的方法
发布日期:2018-03-02     点击:10442     字体:[ ]

一般主机空间都支持脚本映射,在空间里做一个 *.html映射到NET4,然后web.config里添加规则,见下文

 

 <system.webServer>
    <rewrite>
      <rules>
        <rule name="r1">
          <match url="default.html" />
          <action type="Rewrite" url="Default.aspx" />
        </rule>
        <rule name="r10">
          <match url="newsdetail-([0-9]*)-([0-9]*).html" />
          <action type="Rewrite" url="newsdetail.aspx?oid={R:1}&amp;sClass={R:2}" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>

 

 

用户评论
昵称 
内容  *
验证码   
   
相关文章 更多...  
Copyright © 2010 zdbase.com All Rights Reserved. 苏ICP备15039389号-1 可人软件设计