客服联系方式

当前位置:首页 » 伪静态类 » 正文

iis Z-BlogPHP 伪静态规则设置

211 人参与  2025年05月17日 23:02  分类 : 伪静态类  评论

首先在后台插件管理中开启【静态管理中心】,然后进入管理保存伪静态的运行方式。


IIS6 保存一下代码为 httpd.ini 到网站根目录,自动生效。

[ISAPI_Rewrite]

RewriteRule /page_([0-9]*)\.html /index\.php\?page=$1&rewrite=1&full_uri=$0 [I,L]
RewriteRule /date-([0-9\-]+)(?:_)?([0-9]*)\.html /index\.php\?date=$1&page=$2&rewrite=1&full_uri=$0 [I,L]
RewriteRule /author-([0-9]+)(?:_)?([0-9]*)\.html /index\.php\?auth=$1&page=$2&rewrite=1&full_uri=$0 [I,L]
RewriteRule /tags-([0-9]+)(?:_)?([0-9]*)\.html /index\.php\?tags=$1&page=$2&rewrite=1&full_uri=$0 [I,L]
RewriteRule /category-([0-9]+)(?:_)?([0-9]*)\.html /index\.php\?cate=$1&page=$2&rewrite=1&full_uri=$0 [I,L]
RewriteRule /post/([0-9]+)\.html(\?.*)? /index\.php\?id=$1&rewrite=1&full_uri=$0 [I,L]
RewriteRule /([0-9]+)\.html(\?.*)? /index\.php\?id=$1&rewrite=1&full_uri=$0 [I,L]


IIS7保存代码为 web.config 到网站根目录,自动生效。

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
 <system.webServer>
  <rewrite>
   <rules>
 <rule name="/ Z-BlogPHP Imported Rule" stopProcessing="true">
  <match url="^.*?" ignoreCase="false" />
   <conditions logicalGrouping="MatchAll">
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
   </conditions>
  <action type="Rewrite" url="index.php/{R:0}" />
 </rule>
 <rule name="/ Z-BlogPHP Imported Rule index.php" stopProcessing="true">
  <match url="^index.php/.*?" ignoreCase="false" />
   <conditions logicalGrouping="MatchAll">
    <add input="{REQUEST_FILENAME}" matchType="IsFile" />
   </conditions>
  <action type="Rewrite" url="index.php/{R:0}" />
 </rule>
   </rules>
  </rewrite>
 </system.webServer>
</configuration>

来源:州运宝转载请保留出处和链接!

本文链接:https://www.zhouyunbao.com/6.html

本站部分内容来源网络如有侵权请联系删除

<< 上一篇 下一篇 >>

州运宝app建站备忘录

    州运宝|州运宝app|州运宝备忘录

州运宝 |

州运宝