帝國cms的tags頁面url偽靜態的設置


帝國cms的tags頁面url默認是 /e/tags/index.php?tagname=XXX

這種形式的,我們希望的是后綴變成

http://www.lingganzuowen.com/tags-etagid17-0.html(其中后面的0是頁數,前面的id就是tags的id)

其中這種形式的

那么如何來設置呢?

如圖所示:

說明:采用靜態頁面時不需要設置,只有當采用動態頁面時可通過設置偽靜態來提高SEO優化,如果不啟用請留空。注意:偽靜態會增加服務器負擔,修改偽靜態格式后你需要修改服務器的 Rewrite 規則設置。

.htaccess文件內容:(這里我測試機上用的是apche,如果別的環境請自行轉換)

<ifmodule mod_rewrite.c>
RewriteEngine On
ErrorDocument 404 /404.html
Rewritebase /
#信息列表
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^listinfo-(.+?)-(.+?)\.html$ /e/action/ListInfo/index\.php\?classid=$1&page=$2
#信息內容頁
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^showinfo-(.+?)-(.+?)-(.+?)\.html$ /e/action/ShowInfo\.php\?classid=$1&id=$2&page=$3
#標題分類列表頁
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^infotype-(.+?)-(.+?)\.html$ /e/action/InfoType/index\.php\?ttid=$1&page=$2
#TAGS信息列表頁
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^tags-(.+?)-(.+?)\.html$ /e/tags/index\.php\?tagname=$1&page=$2
#評論列表頁
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)\.html$  /e/pl/index\.php\?doaction=$1&classid=$2&id=$3&page=$4&myorder=$5&tempid=$6
</ifmodule>

  nginx的規則如下:

rewrite ^/tags-(.+?)-([0-9]+).html$ /e/tags/index.php?tagname=$1&page=$2 last;

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM