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;