thinkphp框架部署出现404解决
1:虚拟机配置文件修改:
location / {
index index.php index.html;
if (!-e $request_filename) {
rewrite ^/index.php(.*)$ /index.php?s=$1 last; #必须在前面
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
2:项目入口文件:.htaccess
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>