在虚拟主机中建站之星伪静态设置配置代码

在虚拟主机中配置web.config

XML/HTML代码
  1. <?xml version="1.0" encoding="UTF-8"?>  

  2. <configuration>  

  3.     <system.webServer>  

  4.         <rewrite>  

  5.             <rules>  

  6.                 <rule name="1">  

  7.                     <match url="([a-zA-Z_]{1,})-([a-zA-Z_]{1,})\.html$" ignoreCase="false" />  

  8.                     <action type="Rewrite" url="index.php?_m={R:1}&_a={R:2}" appendQueryString="false" />  

  9.                 </rule>  

  10.                 <rule name="2">  

  11.                     <match url="([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([0-9]{1,})\.html$" ignoreCase="false" />  

  12.                     <action type="Rewrite" url="index.php?_m={R:1}&_a={R:2}&{R:3}={R:4}" appendQueryString="false" />  

  13.                 </rule>  

  14.                 <rule name="3">  

  15.                     <match url="([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([0-9]{1,})-([a-zA-Z_]{1,})-([0-9]{1,})\.html$" ignoreCase="false" />  

  16.                     <action type="Rewrite" url="index.php?_m={R:1}&_a={R:2}&{R:3}={R:4}&{R:5}={R:6}" appendQueryString="false" />  

  17.                 </rule>  

  18.                 <rule name="4">  

  19.                     <match url="([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([0-9]{1,})-([a-zA-Z_]{1,})-([0-9]{0,})-([a-zA-Z_]{1,})-([0-9]{0,})\.html$" ignoreCase="false" />  

  20.                     <action type="Rewrite" url="index.php?_m={R:1}&_a={R:2}&{R:3}={R:4}&{R:5}={R:6}&{R:7}={R:8}" appendQueryString="false" />  

  21.                 </rule>  

  22.                 <rule name="5">  

  23.                     <match url="admin/([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([0-9]{1,})-([a-zA-Z_]{1,})-([0-9]{0,})\.html$" ignoreCase="false" />  

  24.                     <action type="Rewrite" url="admin/index.php?_m={R:1}&_a={R:2}&{R:3}={R:4}&{R:5}={R:6}" appendQueryString="false" />  

  25.                 </rule>  

  26.                 <rule name="6">  

  27.                     <match url="admin/([a-zA-Z_]{1,})-([a-zA-Z_]{1,})\.html$" ignoreCase="false" />  

  28.                     <action type="Rewrite" url="admin/index.php?_m={R:1}&_a={R:2}" appendQueryString="false" />  

  29.                 </rule>  

  30.                 <rule name="7">  

  31.                     <match url="admin/([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([0-9]{1,})\.html$" ignoreCase="false" />  

  32.                     <action type="Rewrite" url="admin/index.php?_m={R:1}&_a={R:2}&{R:3}={R:4}" appendQueryString="false" />  

  33.                 </rule>  

  34.                 <rule name="8">  

  35.                     <match url="admin/([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([a-zA-Z_]{1,})-([0-9]{1,})-([a-zA-Z_]{1,})-([0-9]{1,})-([a-zA-Z_]{1,})-([0-9]{0,})\.html$" ignoreCase="false" />  

  36.                     <action type="Rewrite" url="admin/index.php?_m={R:1}&_a={R:2}&{R:3}={R:4}&{R:5}={R:6}&{R:7}={R:8}" appendQueryString="false" />  

  37.                 </rule>  

  38.             </rules>  

  39.         </rewrite>  

  40.     </system.webServer>  

  41. </configuration>  





版权声明

本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,可随意转载(O ^ ~ ^ O),别忘了标明转载来源即可。

评论

精彩评论
  • 2017-12-14 14:41:23

    如何运用到实际东中是关键,主要是自己自会简单的搭建模板。

分享:

支付宝

微信