首先找到web服务的配置文件
AMH /home/wwwroot/PATH/vhost/domainname.conf
nginx写法
location / {
if (!-e $request_filename){
rewrite ^/index.html/?$ /index.php?s= last;
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
然后重启nginx xx/sbin/nginx -s reload
Apache写法
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(Uploads)
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
同样重启apache服务