宝塔 iis下伪静态设置

审核中 百易问题 未结 已结 置顶 精帖
删除 置顶 取消置顶 加精 取消加精
66 0
yswl
yswl VIP3 2021-09-04 11:56:12
悬赏:60金币 编辑此贴

后台:

单页规则:list-{alias}.html

列表规则:list-{alias}.html

列表分页:list-{alias}-{page}.html

内容规则:{alias}/{id}.html

内容分页:{alias}/{id}-{page}.html

TAG规则:tag/{id}.html

TAG分页:tag-{id}-{page}.html


根目录配置文件:web.config

规则:

<rewrite>
 <rules>
  <rule name="xiao_catdir">
   <match url="^(.*/)*list-(\w+).html\?*(.*)$" />
   <action type="Rewrite" url="{R:1}/index.php\?list={R:2}&amp;{R:3}" />
  </rule>
  <rule name="xiao_catdir_page">
   <match url="^(.*/)*list-(\w+)-([0-9]+).html\?*(.*)$" />
   <action type="Rewrite" url="{R:1}/index.php\?list={R:2}&amp;page={R:3}&amp;{R:4}" />
  </rule>
  <rule name="xiao_page">
   <match url="^(.*/)*(\w+)/([0-9]+).html\?*(.*)$" />
   <action type="Rewrite" url="{R:1}/index.php\?show={R:3}&amp;x={R:2}&amp;{R:4}" />
  </rule>
  <rule name="xiao_page_page">
   <match url="^(.*/)*(\w+)/([0-9]+)_([0-9]+).html\?*(.*)$" />
   <action type="Rewrite" url="{R:1}/index.php\?show={R:3}&amp;page={R:4}&amp;x={R:2}&amp;{R:5}" />
  </rule>
 </rules>
</rewrite>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
 <system.webServer>
  <!--start-php-->
  <handlers>
   <remove name="php_5.2" />
   <remove name="php_5.3" />
   <remove name="php_5.4" />
   <remove name="php_5.5" />
   <remove name="php_5.6" />
   <remove name="php_7.0" />
   <remove name="php_7.1" />
   <add name="php_5.6" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="D:\BtSoft\WebSoft\php\5.6\php-cgi.exe" resourceType="Unspecified" requireAccess="Script" />
   <remove name="PageHandlerFactory-ISAPI-2.0-64" />
   <remove name="PageHandlerFactory-ISAPI-2.0" />
   <remove name="SimpleHandlerFactory-ISAPI-2.0-64" />
   <remove name="SimpleHandlerFactory-ISAPI-2.0" />
   <remove name="ASPClassic" />
  </handlers>
  <!--end-php-->
     
  <!--start-rewrite-->
<rewrite>
 <rules>
  <rule name="xiao_catdir">
   <match url="^(.*/)*list-(\w+).html\?*(.*)$" />
   <action type="Rewrite" url="{R:1}/index.php\?list={R:2}&amp;{R:3}" />
  </rule>
  <rule name="xiao_catdir_page">
   <match url="^(.*/)*list-(\w+)-([0-9]+).html\?*(.*)$" />
   <action type="Rewrite" url="{R:1}/index.php\?list={R:2}&amp;page={R:3}&amp;{R:4}" />
  </rule>
  <rule name="xiao_page">
   <match url="^(.*/)*(\w+)/([0-9]+).html\?*(.*)$" />
   <action type="Rewrite" url="{R:1}/index.php\?show={R:3}&amp;x={R:2}&amp;{R:4}" />
  </rule>
  <rule name="xiao_page_page">
   <match url="^(.*/)*(\w+)/([0-9]+)_([0-9]+).html\?*(.*)$" />
   <action type="Rewrite" url="{R:1}/index.php\?show={R:3}&amp;page={R:4}&amp;x={R:2}&amp;{R:5}" />
  </rule>
 </rules>
</rewrite>
  <!--end-rewrite--> 
 </system.webServer>
</configuration>


百易cms
百易问题 1
百易标签 0