使用场景:
主要应用于自有空间或软件版服务器配置伪静态规则。
一、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:
##
# 将以下内容拷贝到相应的配置下面,具体用法和服务器配置有关,可搜索了解
location / {
try_files $uri $uri/ /index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
如配置过程中有问题,可以联系客服人员协助处理。