如果是ngnix中
使用以下规则
location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } }
如果是apache中
修改.htaccess
<IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L] </IfModule>