搭建环境
php8.0 +sql5.7 需安装 SW扩展
以下是伪静态设置 不用设置运行目录
Nginx的
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
location ^~ /protected {
deny all;
}
Apache的
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>