分享帝國cms網站優化使tags偽靜態的實作方法
帝国cms网站优化值tags伪静态的实现步骤如下:
1.修改e/class/t_functions.php中的sys_eShowTags函数
代码如下:
//显示TAGS function 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=' '; } $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.''; $gfont2=''.$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;
}
推荐学习《帝国cms教程》
2.网站根目录 增加.htaccess文件,内容如下
代码如下:
RewriteEngine On RewriteBase / RewriteRule tag/(.*).html$ e/tags/?tagname=$1 RewriteRule 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 FollowSymLinks AllowOverride None
改为
代码如下:
Options FollowSymLinks AllowOverride All
以上是分享帝國cms網站優化使tags偽靜態的實作方法的詳細內容。更多資訊請關注PHP中文網其他相關文章!

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

帝國CMS的手機端設定位於「模板管理」模組的「手機模板」中,具體步驟包括:啟用模板、選擇應用頻道、編輯模板內容,並儲存設定。

透過存取config.inc.php檔案並檢查dositemap設置,可以找到帝國CMS網站地圖。如果設定為"on",則網站地圖已啟用。網站地圖路徑位於sitemapurl設定中,可以透過瀏覽器存取或透過FTP下載。

帝國CMS模板檔案理想的放置位置是/e/template/default/skin/default/,其次還可以放置在/e/data/skins/和/e/skin/,需要注意保持資料夾結構、設定檔案權限以及定期備份。

帝國CMS的自動發布介面位於/e/api/web/postinfo.php,使用步驟如下:存取/e/api/web/postinfo.php 位址使用HTTP POST 提交文章標題、欄位ID、分類ID、作者和文章內容等資料介面會傳回一個JSON 格式的回應,其中包含發佈結果和文章ID

帝國cms百度主動推送插件位於根目錄/e/api/baidu/push.php。具體設定步驟如下:1. 上傳外掛程式至指定路徑。 2. 在帝國cms後台設定「百度主動推送」選項,包括推送位址、API Key和推送間隔。 3. 取得百度推送資訊:推送位址:https://data.zz.baidu.com/urls?site=YOUR_SITE&token=YOUR_API_KEY,API Key:登入百度搜尋資源平台取得。 4. 定期更新API Key,並設定合理的推送間隔。

帝國CMS資料庫設定檔位於網站根目錄下e/config/db.inc.php,它包含以下設定資訊:$dbhost:資料庫伺服器位址$dbuser:資料庫使用者名稱$dbpass:資料庫密碼$dbname:資料庫名稱$dbport :資料庫連接埠$dbcharset:資料庫字元集

是的,帝國CMS是一款免費的開源內容管理系統(CMS)。它是一款輕量CMS,功能豐富,易於使用。帝國CMS遵循GNU通用公共授權(GPL),這意味著它可以免費下載、安裝和使用。對於商業用途,它提供了付費版本,提供額外的功能和支持,例如廣告管理、線上支付和高級技術支援。

帝國CMS模板下載位置:官方模板下載:https://www.phome.net/template/第三方模板網站:https://www.dedecms.com/diy/https://www.0978.com.cn /https://www.jiaocheng.com/安裝方式:下載模板解壓縮模板上傳模板選擇模板
