微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

WDCP配置ThinkPHP5伪静态隐藏index.php,出现“”解决重定向次数过”问题

站点域名的配置:xxx.com.conf

server {
        listen       80;
        root /www/web/xxx_com/public_html;
        server_name xxx.com;
        index  index.html index.PHP index.htm;
        error_page  400 /errpage/400.html;
        error_page  403 /errpage/403.html;
        error_page  404 /errpage/404.html;
        error_page  503 /errpage/503.html;
        location ~ \.PHP(.*)$ {
            fastcgi_pass  unix:/tmp/PHP-70-cgi.sock;
            fastcgi_index  index.PHP;
            #fastcgi_param  SCRIPT_FILENAME  $DOCUMENT_ROOT$fastcgi_script_name;
            #fastcgi_param PATH_INFO $2;
            include fcgi.conf;
       #下面追加的 set
$real_script_name $fastcgi_script_name; set $path_info ""; if ($fastcgi_script_name ~ "^(.+?\.PHP)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } location ~ /\.ht { deny all; } location / {
       #伪静态重写的
if (!-e $request_filename) { rewrite ^/(.*)$ /index.PHP/$1 last; break; } try_files $uri $uri/ /?$args; } }

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐