Laravel
nginx
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}
apache
ThinkPHP
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>