服务器系统:Linux + Centos7.x + 宝塔
亲测环境:Nginx 1.18.0 + PHP5.6 + Mysql5.5 Apache也测试OK
数据库配置文件:/Application/Common/Conf/db.php
Nginx伪静态
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
Apache伪静态
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]
</IfModule>