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

WBOY
Release: 2016-06-13 12:27:19
Original
981 people have browsed it

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

本帖最后由 q309056448 于 2015-11-10 00:32:06 编辑 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中的虚拟机配置:
<br />	server {<br />        listen       80;<br />        server_name  aa.baidu.dd;<br />		index index.php;<br />		client_max_body_size 5M;<br />		client_body_buffer_size 128k;<br />		<br />        charset utf-8;<br />        location / {<br />            root   /var/www/baidu/wx;<br />            index  index.php;<br />			if (!-e $request_filename)<br />			{<br />				rewrite  ^/(.*)$  /index.php/$1  last;<br />				break;<br />			}<br />        }<br />        error_page  404              /404.html;<br />        error_page   500 502 503 504  /50x.html;<br />        location = /50x.html {<br />            root   html;<br />        }<br />		<br />		location ~ .+\.php($|/){<br />			set $script    $uri;<br />			set $path_info  "/";<br />			if ($uri ~ "^(.+\.php)(/.+)")<br />			{<br />				set $script     $1;<br />				set $path_info  $2;<br />			}<br />            fastcgi_pass   127.0.0.1:9000;<br />            fastcgi_index  index.php;<br />            fastcgi_param  SCRIPT_FILENAME  /var/www/baidu/wx$fastcgi_script_name;<br />            include        fastcgi_params;<br />        }<br />    }<br />
Copy after login

------解决思路----------------------
rewrite  ^/(.*)$  /index.php/$1  last;
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template