国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

thinkphp nginx配置rewrite,地址會多出個.php
為情所困
為情所困 2017-06-16 09:18:37
0
2
961

thinkphp nginx配置rewrite,地址會多出個.php
,http://localhost:7080/.php?m=...
nginx配置文件
server
{

    listen 80;
    #listen [::]:80;
    server_name localhost 192.168.150.79 doc.mall.com;
    index index.html index.htm index.php default.html default.htm default.php;
    root  /data/www/wwwroot/mall_doc;

include none.conf;

    #error_page   404   /404.html;
    location / {
            if (!-e $request_filename)
    {
            rewrite ^/index.php(.*)$ /index.php?s= last;
            rewrite ^(.*)$ /index.php?s= last;
            rewrite ^/(.*)$ /index.php/;
    }
    }

location ~ .php {

            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            set $path_info "";
            set $real_script_name $fastcgi_script_name;
            if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
                    set $real_script_name ;
                    set $path_info ;
            }
            fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
            fastcgi_param SCRIPT_NAME $real_script_name;
            fastcgi_param PATH_INFO $path_info;
    }

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
            expires      30d;
    }

    location ~ .*\.(js|css)?$
    {
            expires      12h;
    }

access_log  /data/www/wwwlogs/doc.mall.access_log;

}

rewrite ^/index.php(.*)$ /index.php?s=$1 last;
rewrite ^(.*)$ /index.php?s=$1 last;
rewrite ^/(.*)$ /index.php/$1;
這三種方式都試過了
'URL_MODEL' => 2,
php版本為PHP 7.1.5

nginx版本為:nginx/1.12.0

大家有么碰到這種情況?
php版本在5.6.9上是正常訪問

為情所困
為情所困

全部回復(2)
某草草

之前我配置THINKCMF的時候也出現(xiàn)過這個問題

    if(!defined('_PHP_FILE_')) {
        if(IS_CGI) {
            //CGI/FASTCGI模式下
            $_temp  = explode('.php',$_SERVER['PHP_SELF']);
            define('_PHP_FILE_',    rtrim(str_replace($_SERVER['HTTP_HOST'],'',$_temp[0].'.php'),'/'));
        }else {
            define('_PHP_FILE_',    rtrim($_SERVER['SCRIPT_NAME'],'/'));
        }
    }

后來找到問題是這個$_SERVER['SCRIPT_NAME'] 常量中的路徑出現(xiàn)問題有2個解決放過
1.你修改常量中的數(shù)據(jù)
2.使用APACHE
目前就想到這2個方法
另外可以關注我的博客 PHP程序員學習筆記

巴扎黑

雷雷

最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板