1 nginx 重定向

server {
        listen 80;
        root /vagrant/basic/web;
        index  index.html index.htm index.php;
        server_name www.basic.com;
       location / {
                index index.php;
                if (!-e $request_filename){#
                    rewrite ^/(.*) /index-test.php last;
                }
        }
        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/run/php/php7.1-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }
}

2 项目basic/config/web.php components 添加

      'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'enableStrictParsing' => false,
            'rules' => [
            ],
        ],

相关文章:

  • 2021-11-30
  • 2022-12-23
  • 2021-10-08
  • 2022-12-23
  • 2021-08-31
  • 2021-10-16
  • 2021-06-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
相关资源
相似解决方案