0
采纳
1.在thinkphp配置文件将URL模式改成
'URL_MODEL'=> '2', //REWRITE模式
2.Apache服务器,将下面的内容保存为.htaccess文件放到index.php入口文件的同级目录
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
Nginx服务器,Nginx.conf中配置
location / { // …..省略部分代码
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}