木子屋 Dnawo's BLOG

西部数码虚拟主机伪静态功能使用示例

👤 dnawo 📅 2014-05-14 👁 3407 👍 0 💬 0 🔄 本站原创
图片

图片

选择伪静态模板确定后会在站点根目录生成一个伪静态规则配置文件web.config,不同的模板伪静态规则不太一样[1],根据需要修改规则网站即可使用伪静态,以ecshop模板为例,下边是修改后的配置文件:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="1" stopProcessing="true">
          <match url="^about\.html$" ignoreCase="true" />
          <action type="Rewrite" url="about/index.asp" />
        </rule>
        <rule name="2" stopProcessing="true">
          <match url="^news\/(\d+)\.html$" ignoreCase="true" />
          <action type="Rewrite" url="view/index.asp?id={R:1}.asp" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

说明:选择伪静态模板不是说网站就得使用这套程序,例如上边选择ecshop模板但网站实际是一个asp企业站。

补充说明

[1].西部数码伪静态模板大全:http://www.mzwu.com/pic/201405/west263-urlrewrite-webconfig.rar

评论(0)

暂无评论。

计算题
评论需审核通过后显示
← 上一篇 C#使用UdpClient发送和接收UDP数据示例 下一篇 → 随机数是骗人的,.Net、Java、C为我作证