伪静态规则
系统安装完成务必设置好伪静态,否则网站无法正常访问
nginx 伪静态规则
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php last;
}
1
2
3
4
2
3
4
警告
nginx 环境下需要关闭静态文件对缓存策略
即css js以及图片的expires设置为off
apache 伪静态规则
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,PT,L]
</IfModule>
1
2
3
4
5
6
7
2
3
4
5
6
7
iis 伪静态规则
<rewrite>
<rules>
<rule name="OrgPage" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^(.*)$" />
<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>
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13