ci的url,加上入口文件和不加入口文件,为啥差别这么大?

WBOY
풀어 주다: 2016-06-23 13:23:02
원래의
940명이 탐색했습니다.

http://aa.baidu.dd/index.php/fdsafdeeee/index/1.html
http://aa.baidu.dd/index.php/joifdafdfdsan/index/1.html
http://aa.baidu.dd/index.php/feppppoin/indefdasfdax/1.html
无论写啥都跑到默认home控制器了,哪怕是index.php后面的控制器不存在。
但是只要去掉index.php,就没问题了,指哪打哪,这是神马原因
下面是我在nginx中的虚拟机配置:

	server {        listen       80;        server_name  aa.baidu.dd;		index index.php;		client_max_body_size 5M;		client_body_buffer_size 128k;		        charset utf-8;        location / {            root   /var/www/baidu/wx;            index  index.php;			if (!-e $request_filename)			{				rewrite  ^/(.*)$  /index.php/$1  last;				break;			}        }        error_page  404              /404.html;        error_page   500 502 503 504  /50x.html;        location = /50x.html {            root   html;        }				location ~ .+\.php($|/){			set $script    $uri;			set $path_info  "/";			if ($uri ~ "^(.+\.php)(/.+)")			{				set $script     $1;				set $path_info  $2;			}            fastcgi_pass   127.0.0.1:9000;            fastcgi_index  index.php;            fastcgi_param  SCRIPT_FILENAME  /var/www/baidu/wx$fastcgi_script_name;            include        fastcgi_params;        }    }
로그인 후 복사


回复讨论(解决方案)

明白了  是nginx配置问题

rewrite  ^/(.*)$  /index.php/$1  last;

원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!