thinkphp nginx 404错误

来源:互联网 发布:windows系统正版 编辑:程序博客网 时间:2024/04/27 12:54
location ~ ^(.+.php)(.*)$        {                fastcgi_pass  unix:/tmp/php-cgi-rl.chuangjiangnet.cn.sock;                fastcgi_index index.php;                fastcgi_split_path_info ^(.+\.php)(.*)$;                fastcgi_param PATH_INFO $fastcgi_path_info;                include fcgi-host.conf;                fastcgi_param DOCUMENT_ROOT  /web$subdomain;                fastcgi_param SCRIPT_FILENAME  /web$subdomain$fastcgi_script_name;        }
server{        listen       80;        server_name rl.chuangjiangnet.cn; #server_name end        index index.html index.htm index.php; #index end        set $subdomain '';        root  /home/wwwroot/rl.chuangjiangnet.cn/web$subdomain;        include rewrite/runlong.conf; #rewrite end        #error_page        location ~ /ErrorPages/(400|401|403|404|405|502|503)\.html$        {                root /home/wwwroot/rl.chuangjiangnet.cn/web;        }location ~ ^(.+.php)(.*)$        {                fastcgi_pass  unix:/tmp/php-cgi-rl.chuangjiangnet.cn.sock;                fastcgi_index index.php;                fastcgi_split_path_info ^(.+\.php)(.*)$;                fastcgi_param PATH_INFO $fastcgi_path_info;                include fcgi-host.conf;                fastcgi_param DOCUMENT_ROOT  /web$subdomain;                fastcgi_param SCRIPT_FILENAME  /web$subdomain$fastcgi_script_name;        }        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp3|wma)$        {                expires      30d;        }        location ~ .*\.(js|css)$        {                expires      12h;        }        access_log /home/wwwroot/rl.chuangjiangnet.cn/log/access.log combined; #access_log end        error_log /home/wwwroot/rl.chuangjiangnet.cn/log/error.log crit; #error_log end}
做相应替换
修改完之后,返现访问网址居然自动省略了index  


而且css 样式也不解析,

找了半天发现

是thinkphp 自身框架的原因

在 Thinkphp/ThinkPHP.php里面加入

define('_PHP_FILE_',    rtrim($_SERVER['SCRIPT_NAME'],'/'));  搞定

0 0