#帮助#轻博客伪静态规则

本规则于2019/11/29日更新适用于2.0以上版本

Apache: .htaccess

#Options +FollowSymlinks #本条非必需

RewriteEngine on

#博客安装目录以/结尾

RewriteBase / 

RewriteCond %{REQUEST_FILENAME} !-d 

RewriteCond %{REQUEST_FILENAME} !-f 

RewriteRule post-([0-9]+)\.html$ index.php?act=pl&id=$1 [L]

RewriteRule comment-([0-9]+)\.html$  index.php?act=plist&p=$1 [L]

RewriteRule index-([0-9]+)\.html$ index.php?p=$1 [L]

RewriteRule list-([0-9]+)\.html$ index.php?tid=$1 [L]

RewriteRule list-([0-9]+)-([0-9]+)\.html$ index.php?tid=$1&p=$2 [L]

RewriteRule index\.html$ index.php [L]

RewriteRule comment\.html$ index.php?act=plist [L]

Ngnix:

rewrite ^/post-([0-9]+).html /index.php?act=pl&id=$1 last;rewrite ^/comment-([0-9]+).html /index.php?act=plist&p=$1 last;rewrite ^/index-([0-9]+).html /index.php?p=$1 last;

rewrite ^/list-([0-9]+)\.html$ /index.php?tid=$1 last;

rewrite ^/list-([0-9]+)-([0-9]+)\.html$ /index.php?tid=$1&p=$2 last;

rewrite ^/index.html /index.php last;rewrite ^/comment.html /index.php?act=plist last;

IIS:web.config :

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>         
<rule name="rule11" stopProcessing="true">
<match url="^post-([0-9]+).html" />
<action type="Rewrite" url="index.php?act=pl&amp;id={R:1}" />
</rule>
<rule name="rule13" stopProcessing="true">
<match url="^comment-([0-9]+).html" />
<action type="Rewrite" url="index.php?act=plist&amp;p={R:1}"  />
</rule>
<rule name="rule14" stopProcessing="true">
<match url="^index-([0-9]+).html" />
<action type="Rewrite" url="index.php?p={R:1}" />
</rule>
<rule name="rule15" stopProcessing="true">
<match url="^index.html" />
<action type="Rewrite" url="index.php" />
</rule>
<rule name="rule16" stopProcessing="true">
<match url="^comment.html" />
<action type="Rewrite" url="index.php?act=plist" />
</rule>
<rule name="rule17" stopProcessing="true">
<match url="list-([0-9]+).html" />
<action type="Rewrite" url="index.php?tid={R:1}" />
</rule>
<rule name="rule18" stopProcessing="true">
<match url="list-([0-9]+)-([0-9]+).html" />
<action type="Rewrite" url="index.php?tid={R:1}&amp;p={R:2}" />
</rule>
</rules>
</rewrite>
</system.webServer>     
</configuration>

2020-04-27 18:13:46 通过 网页 浏览(529)

共有0条评论!

发表评论

更换一道题!
回顶部