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

本规则只适用于v1.3及以下版本

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 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 ^/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>

                </rules>        

             </rewrite>
    </system.webServer>     
</configuration>

2019-04-17 09:49:16 通过 网页

共有2条评论!

  1. Ngnix 2019-04-19 11:34:32 1#

    Ngnix 无用

      回复已更正,宝塔面板ngnix测试通过

  2. 绿匣子 2019-07-10 05:07:09 2#

    https://i.bmp.ovh/imgs/2019/07/46ef5eb68ebc2da7.png

      回复然后问题呢?

发表评论