Voting

: min(seven, four)?
(Example: nine)

The Note You're Voting On

YangQingRong at wudimei dot com
4 years ago
nginx重写不知为什么死循环

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

/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/Index

后来我改成查询字符串就解决了。

location / {

index index.php index.html index.htm;
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?_path_info=/$1 last;
}
}

在index.php中,把query string "_path_info" 放到$_SERVER变量中。
<?php
ini_set
("display_errors",true);
error_reporting(E_ALL|E_ERROR);

//print_r($_SERVER);

$_SERVER['PATH_INFO']=@$_GET['_path_info']; //加这一行,yaf只认PATH_INFO

define("APPLICATION_PATH",dirname(__DIR__));

$app = new Yaf\Application(APPLICATION_PATH.'/conf/application.ini');

$app->bootstrap()->run();

?>

<< Back to user notes page

To Top