Nginx伪静态
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
Apache伪静态
在网站根目录下创建.htaccess
文件,设置内容如下:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>