国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 帝國Empire > 正文

帝國cms網站優化使tags偽靜態的實現

2024-07-09 23:00:49
字體:
來源:轉載
供稿:網友

帝國cms網站優化值tags偽靜態的實現步驟如下:
1.修改e/class/t_functions.php中的sys_eShowTags函數

2.網站根目錄 增加.htaccess文件,內容如下

//顯示TAGSfunction sys_eShowTags($cid,$num=0,$line=0,$order='',$isgood='',$isgoodshow='',$showjg='',$shownum=0,$cs=''){global $empire,$dbtbpre,$public_r,$navinfor;$str='';if(empty($showjg)){$showjg=' &nbsp; ';}$ln=0;if($cid=='selfinfo'){if(empty($navinfor['infotags'])){return '';}$jg='';$r=explode(',',$navinfor['infotags']);$count=count($r);for($i=0;$i<$count;$i++){$ln++;$br='';if($line){if($ln%$line==0){$br='';}}$str.=$jg.'<a href="'.$public_r[newsurl].'e/tags/?tagname='.urlencode($r[$i]).$cs.'" target="_blank">'.$r[$i].'</a>'.$br;$jg=$br?'':$showjg;}}else{$and='';$where='';if($cid){$where=strstr($cid,',')?"cid in ($cid)":"cid='$cid'";$and=' and ';}if($isgood){$where.=$and.'isgood=1';}if($where){$where=' where '.$where;}$order=$order?' '.$order:' tagid desc';$limit='';if($num){$limit=' limit '.$num;}//推薦標紅$gfont1='';$gfont2='';if($isgoodshow){if(strstr($isgoodshow,'r')){$gfont1='<font color="red">';$gfont2='</font>';}if(strstr($isgoodshow,'s')){$gfont1=$gfont1.'<b>';$gfont2='</b>'.$gfont2;}}$jg='';$snum='';$sql=$empire->query("select tagid,tagname,num,isgood from {$dbtbpre}enewstags".$where." order by".$order.$limit);while($r=$empire->fetch($sql)){if($shownum){$snum='('.$r[num].')';}$font1='';$font2='';if($isgoodshow&&$r[isgood]){$font1=$gfont1;$font2=$gfont2;}$ln++;$br='';if($line){if($ln%$line==0){$br='';}}//$str.=$jg.'<a href="'.$public_r[newsurl].'e/tags/?tagid='.$r[tagid].$cs.'" target="_blank">'.$font1.$r[tagname].$snum.$font2.'</a>'.$br;$str.=$jg.'<a href="'.$public_r[newsurl].'e/tags/'.$r[tagid].'.html" target="_blank">'.$font1.$r[tagname].$snum.$font2.'</a>'.$br;$jg=$br?'':$showjg;}}echo $str;}
RewriteEngine OnRewriteBase /RewriteRule tag/(.*).html$ e/tags/?tagname=$1RewriteRule e/tags/(.*).html$ e/tags/?tagid=$1

還要空間支持偽靜態

1.檢測Apache是否支持mod_rewrite 通過php提供的phpinfo()函數查看環境配置,通過Ctrl+F查找到“Loaded Modules”,其中列出了所有apache2handler已經開啟的模塊,如果里面包括“mod_rewrite”,則已經支持,不再需要繼續設置。

如果沒有開啟“mod_rewrite”,則打開目錄 您的apache安裝目錄“/apache/conf/” 下的 httpd.conf 文件,通過Ctrl+F查找到“LoadModule rewrite_module”,將前面的”#”號刪除即可。

如果沒有查找到,則到“LoadModule” 區域,在最后一行加入“LoadModule rewrite_module modules/mod_rewrite.so”(必選獨占一行),然后重啟apache服務器即可。

2.讓apache服務器支持.htaccess

修改httpd.conf文件

Options FollowSymLinksAllowOverride None

改為

Options FollowSymLinksAllowOverride All
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 勐海县| 沅江市| 张家口市| 普兰县| 游戏| 玛沁县| 阿拉尔市| 咸阳市| 乐安县| 二连浩特市| 海口市| 扶沟县| 曲周县| 靖江市| 白玉县| 三穗县| 丰都县| 宜春市| 凤阳县| 石泉县| 阿城市| 桃园县| 砀山县| 桐柏县| 平利县| 博乐市| 龙岩市| 兴宁市| 鹿泉市| 斗六市| 崇信县| 历史| 会宁县| 定结县| 宣汉县| 四会市| 马龙县| 蒙自县| 饶平县| 淮阳县| 仙游县|