iis下常用程序的伪静态规则列表(包括wordpress、thinkphp)

Mr.zhuMr.zhu2025-09-03 21:30:10来源:吾爱汇编 (www.52hb.com)阅读:80

shopex discuz2.0 discuz2.5 discuz3.x 淘宝客 ecshop phpwind参照http://www.west.cn/faq/list.asp?unid=797通过主机面板设置即可

wordpress设置(系统不推荐Windows,如果可以更换为linux系统运行更稳定):

第一步:

 登陆wordpress后台,设置--固定链接--自定义结构,选择设置下URL格式。

第二步:

新建一个文件命名为:web.config,在里面写入以下规则,上传到wwwroot目录。

<?xml version="1.0" encoding="UTF-8"?>
  <configuration>
   <system.webServer>
     <rewrite>
       <rules>
         <rule name="URL" stopProcessing="true">
          <match url="^(.*)$" />
          <conditions>
             <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
             <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
           </conditions>
          <action type="Rewrite" url="index.php"/>
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

Thinkphp伪静态规则:

 手工创建web.config文件到站点根目录

<?xml version="1.0" encoding="UTF-8"?>
   <configuration>
     <system.webServer>
       <rewrite>
         <rules>
            <rule name="Imported Rule 1" stopProcessing="true">
              <match url=".*\.(?:gif|jpg|png|css|js|txt|jpeg|swf|flv)" />
             <action type="Rewrite" url="{R:0}" />
           </rule>
            <rule name="Imported Rule 2">
             <match url="/httpd(?:\.ini|\.parse\.errors)" />
              <action type="CustomResponse" url="/" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
            </rule>
           <rule name="Imported Rule 3" stopProcessing="true">
              <match url="^(?!/index.php)(?!/admin.php)(.*)$" ignoreCase="false" />
              <conditions logicalGrouping="MatchAll">
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
              </conditions>
             <action type="Rewrite" url="/index.php/{R:1}" />
           </rule>
        </rules>
      </rewrite>
   </system.webServer>
</configuration>

猜你想看

麦肯锡解决问题的7步法,让你快速抓到问题的本质
想要吃糖不背“包袱”?教你5个“控糖”小技巧
领导提拔你的原因,能力是其次,这4点才真实,其他纯属瞎扯
跑步最容易忽视的两个问题,你有没有意识到?
空调匹数?你选对了吗?
在北方城市买房,为啥很多人不再装地暖了?6个原因
领了失业金,影响养老待遇?关于失业金的四大误区
腕表知识〡十步了解机械表
一文说尽住房公积金贷款,有备无患,保存备用
小龙虾价格近乎腰斩!“抄底”吃虾的季节到了
戒指的戴法和意义分别是什么,男士戒指的正确戴法
关于借车那些事儿
“狮子头”与“四喜丸子”为啥不一样,区别在哪里?
“中国天眼”最新重大发现揭秘黑洞“脉搏”
不作死就不会死,职场上自断后路的三种做法,看看你“踩雷”了没
逆水寒手游哪个职业输出最高,逆水寒手游输出最高的职业排行榜
葡萄酒界的高低贵贱,你知道吗?
一个女人最好的生活状态
【一文搞懂】啥是裁决书、裁定书、决定书、判决书?
原来“无人驾驶”只是个误会?看来车企们的“梦想”要落空了

推荐站点