#1 redguan
一、APACHE服务器配置支持.htaccess二、.htaccess 语句
RewriteRule . index.php [L]
相当于:
访问:http://xxx.com/index.php/main/list/pid/223 (地址一)
相当于: http://xxx.com/main/list/pid/223 (地址二)
但是,这样无论后面是什么参数,都是相当于访问 http://xxx.com 即SP无法通过(地址二)获得C和A参数
现在的问题是,SPURL生成的地址,SP能正确读取
三、修改函数: spUrl
当打开PATH_INFO开关时,使用RE_WRITE
原代码:
if( TRUE == $GLOBALS['G_SP']['url']["url_path_info"] ){ // 使用path_info方式
$url = $GLOBALS['G_SP']['url']["url_path_base"]."/{$controller}/{$action}";
if(null != $args)foreach($args as $key => $arg) $url .= "/{$key}/{$arg}";
}else{
四、修改 spconfig.php
'url' => array( // URL设置
'url_path_info' => TRUE, // 是否使用path_info方式的URL
'url_path_base' => '', // URL的根目录访问地址
),
2010-03-13 10:37:53