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>

相关文章:

  • 2021-12-16
  • 2021-11-01
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
  • 2021-09-05
  • 2022-02-09
  • 2021-05-23
猜你喜欢
  • 2022-02-07
  • 2022-12-23
  • 2021-09-26
  • 2021-05-29
  • 2021-06-04
  • 2021-09-30
相关资源
相似解决方案