Emlog伪静态规则

ZJ
ZJ
2020-11-04 / 0 评论 / 178 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2020年11月04日,已超过1464天没有更新,若内容或图片失效,请留言反馈。

iis6主机请联系主机商修改规则,部分主机支持httpd.ini,请将下列代码保存为httpd.ini上传到博客根目录

[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
RewriteRule /robots.txt(.*) /robots.txt$1 [L]
RewriteRule /rss.php(.*) /rss.php$1 [L]
RewriteRule /tb.php(.*) /tb.php$1 [L]
RewriteRule /favicon.ico /favicon.ico [L]
RewriteRule /xmlrpc.php(.*) /xmlrpc.php$1 [L] 
RewriteRule /wlwmanifest.xml /wlwmanifest.xml [L] 
RewriteRule /(t|m)$ /$1/ [R]
RewriteRule /(admin|content|include|t|m)/(.*) /$1/$2 [L]
RewriteRule /install.php(.*) /install.php$1 [L]
RewriteRule /emlog_toolkit.php(.*) /emlog_toolkit.php$1 [L]
RewriteRule /up(\d.\d.\d)to(\d.\d.\d).php(.*) /up$1to$2.php$3 [L]
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]

apache:(网站根目录下存在.htaccess 文件,.htaccess的代码如下)

<IfModule mod_rewrite.c>  
                 RewriteEngine on   
                 RewriteCond %{REQUEST_FILENAME} !-f    
                 RewriteCond %{REQUEST_FILENAME} !-d     
                 RewriteBase /    
                 RewriteRule . /index.php [L]  
             </IfModule>

nginx:(nginx主机请联系主机商更改规则,部分主机可能支持自定义规则)

location / {
        index index.php index.html;
        if (!-e $request_filename)
        {
                rewrite ^/(.+)$ /index.php last;
        }
}

IIS7/7.5 规则

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="emlog 4.0.1 for IIS7.5" stopProcessing="true">
                  <match url="." ignoreCase="false" />
                   <conditions logicalGrouping="MatchAll">
                   <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                   <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                   </conditions>
                  <action type="Rewrite" url="/index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>
本文共 192 个字数,平均阅读时长 ≈ 1分钟
0

评论 (0)

取消