使用場(chǎng)景:
主要應(yīng)用于自有空間或軟件版服務(wù)器配置偽靜態(tài)規(guī)則。
一、IIS6:
#
# httpd.ini
#
[ISAPI_Rewrite]
# 3600 = 1 Hour
CacheClockRate 3600
RepeatLimit 32
RewriteRule /(.*) /index.php [L]
二、IIS7+:
<?xml version="1.0"encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="wordpress" patternSyntax="Wildcard">
<match url="*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
三、Apache:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
四、Nginx:
##
# 將以下內(nèi)容拷貝到相應(yīng)的配置下面,具體用法和服務(wù)器配置有關(guān),可搜索了解
location / {
try_files $uri $uri/ /index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
如配置過程中有問題,可以聯(lián)系客服人員協(xié)助處理。