/includes/sef.php
将:
defined( '_VALID_MOS' ) or die( 'Restricted access' );
替换为:
defined( '_VALID_MOS' ) or die( 'Restricted access' );
$_SERVER['REQUEST_URI']=str_replace(".html","",$_SERVER['REQUEST_URI']); 将18行左右:
$url_array = explode('/', $_SERVER['REQUEST_URI']); 替换为:
$url_array = explode('/', $_SERVER['REQUEST_URI']=str_replace(".html","",$_SERVER['REQUEST_URI'])); 搜索下行代码第一个出现的地方[约在513行左右]
// allows SEF without mod_rewrite
在其上面增加
if(!strcasecmp(substr($string,-1),"/"))$string=substr($string,0,-1);
if($string!="")$string.=".html";
ok. 这样,你的也就有了这个 .html 的尾巴了...
不一定适合所有的组件. 如果你刚好碰到了可能要用下面的样子来替换上面的两行:
if (!eregi("com_docman",$string)){
if(!strcasecmp(substr($string,-1),"/"))$string=substr($string,0,-1);
if($string!="")$string.=".html";
}注意: 上面代码里出现的 com_docman 就是在com_docman 里不加这个尾巴.你的看着改.
其实我用的是:
$string=substr($string,0,-1);
$string.=".html";
都没加判断...因为我用的东西也不多,使用过程没发现异常... ^_^
最近很忙, 乘今天升级之际顺便先简单写出来, 供需要的人参考.