你的位置:LAMP之窗 >> 资讯 >> SupeSite >> 详细内容 在线投稿

supesite页面链接静态化修改方法

热度135票  浏览101次 【共0条评论】【我要评论 时间:2010年3月21日 15:33
        蘑菇在研究supesite代码时发现,supesite的html静态设置,起链接均为?action-xxxx-xxx,然后通过程序判断html是否存在及其修改时间,来生成或跳转到/html/xxxxx,虽然header指定了301,但这样的处理对于搜索引擎还是不够友好,所以蘑菇修改程序实现链接的静态化

       1,修改function/common.func.php

        查找

       
function geturl($pstring, $urlmode=0) {       
        global $_SGLOBAL, $_SCONFIG, $spaceself;

        添加

       
if($out[1]&&$out[2]){
    return '/html/'.substr($out[1],-2).'/n-'.$out[1].'-'.$out[2].'.html';
}
preg_match('/action\/viewnews\/itemid\/(.*?)\//',$pstring.'/',$out);
if($out[1]){
    return '/html/'.substr($out[1],-2).'/n-'.$out[1].'.html';
}
preg_match('/action\/category\/catid\/(.*?)\/page\/(.*?)\//',$pstring.'/',$out);
if($out[1]&&$out[2]){
    return '/html/'.$out[1].'/category-catid-'.$out[1].'-page-'.$out[2].'.html';
}
preg_match('/action\/category\/catid\/(.*?)\//',$pstring.'/',$out);
if($out[1]){
    return '/html/'.$out[1].'/category-catid-'.$out[1].'.html';
}
preg_match('/action\/(.*?)\//',$pstring.'/',$out);
if($out[1]=='news'){
    return '/html/'.$out[1].'.html';
}

        2,修改根目录的error.php

        具体参见《supesite自动更新html静态化文件》一文中关于error.php的设置
TAG: supesite Supesite 搜索引擎 静态化
顶:10 踩:9
对本文中的事件或人物打分:
当前平均分:-0.33 (40次打分)
对本篇资讯内容的质量打分:
当前平均分:-1.16 (38次打分)
【已经有38人表态】
10票
感动
2票
路过
5票
高兴
3票
难过
6票
搞笑
7票
愤怒
1票
无聊
4票
同情
上一篇 下一篇
发表评论

网友评论仅供网友表达个人看法,并不表明本网同意其观点或证实其描述。

查看全部回复【已有0位网友发表了看法】
       

网络资源