在单斜杠下
http://test.mall.com/
string '/index.php?m=ceshi&a=ceshi' (length=27)
string '/index.php?m=ceshi&a=ceshi' (length=27)
在双斜杠下
http://test.mall.com//
string '//index.php?m=ceshi&a=ceshi' (length=27)
string '//index.php?m=ceshi&a=ceshi' (length=27)
如果 //index.php?m=ceshi&a=ceshi 出现在表单中 则会跳转到index.php的域名下 这样无法正确访问
现在修改Common/runtime.php中 第40行开始
if(!defined('_PHP_FILE_')) {
if(IS_CGI) {
//CGI/FASTCGI模式下
$_temp = explode('.php',$_SERVER['PHP_SELF']);
define('_PHP_FILE_', rtrim(str_replace($_SERVER['HTTP_HOST'],'',$_temp[0].'.php'),'/'));
}else {
define('_PHP_FILE_', rtrim($_SERVER['SCRIPT_NAME'],'/'));
}
}修改为 if(!defined('_PHP_FILE_')) {
if(IS_CGI) {
//CGI/FASTCGI模式下
$_temp = explode('.php',$_SERVER['PHP_SELF']);
define('_PHP_FILE_', rtrim(str_replace($_SERVER['HTTP_HOST'],'',$_temp[0].'.php'),'/'));
}else {
$script_name = '/' . ltrim($_SERVER['SCRIPT_NAME'], '/');
define('_PHP_FILE_', rtrim($script_name, '/'));
}
} 最佳答案