lnmp integrated environment does not support pathinfo mode

[ Nginx ]

In Nginx low version is not supported PATHINFO, but can be implemented by configuring forwarding rules in Nginx.conf in:

  location / { // …..省略部分代码
   if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } } 

In fact, the interior is forwarded to a compatible URL ThinkPHP provided this way, can solve the other does not support PATHINFO WEB server environment.

If your application is installed in the secondary directory, Nginxpseudo-static method set as follows, which youdomainis the name of the directory is located.

location /youdomain/ {
    if (!-e $request_filename){ rewrite ^/youdomain/(.*)$ /youdomain/index.php?s=/$1 last; } }

可查看tp5完全手册配置:https://www.kancloud.cn/manual/thinkphp5/177576
 

Guess you like

Origin www.cnblogs.com/betobe/p/11300806.html