自定義蘋果cms偽靜態路由規則是在正常設置偽靜態后的操作,首先要確定設置偽靜態后網站正常打開,基礎的偽靜態設置教程可以參考此文檔進行設置:http://www.companysz.com/document/cms/4984.html 然后再去自定義路由規則。
一,下圖就是我們要設置路由規則的路徑,自定義路由規則要遵循以下幾個條件。
1.動態模式下,開啟路由狀態將自動重寫URL;
2.路由規則每行一條,中間用=>隔開,左邊是路由表達式,右邊是路由地址;
3.路由地址是系統提供的,原則上不會變,只需要調整路由表達式。
4.不要有多余的空行;
5.ID類型根據需要自行選擇,選擇拼音時,數據中不能有重復的拼音,否則獲取數據會出現問題。
6.URL分隔符支持/ 和 - 。不建議用其他符號。
二,自定義路由規則首先要清楚認識路由規則定義的名稱,下圖詳細的注明了我們要自定義規則的名稱。如果你想改視頻,專題,文章等或其他頁面的規則請按對應名稱修改即可。
三,下面自定義幾個規則案例可供參考。
默認【專題內容頁面】
topicdetail- => topic/detail
修改后
zhuanti/ => topic/detail
最后顯示樣式:http://www.xxx.cn/zhuanti/2018nianrebolianxuju.html
默認【播放頁面】
vodplay/— => vod/play
修改后
p/— => vod/play
最后顯示樣式:http://www.xxx.cn/p/16825-1-1.html
默認【視頻內容頁】
voddetail- => vod/detail
修改后
v/ => vod/detail
最后顯示樣式:http://www.xxx.cn/v/21709.html
默認【文章內容頁面】
artdetail— => art/detail
artdetail- => art/detail
修改后
nes/- => art/detail
nes/ => art/detail
最后顯示樣式:http://www.xxx.cn/nes/10.html
四,如果你改亂了規則出現異?;蚴谴虿婚_頁面可以復制下面蘋果cms初始默認規則代碼進行重置。
map => map/indexrss => rss/indexindex-<page?> => index/indexgbook-<page?> => gbook/indexgbook$ => gbook/indextopic-<page?> => topic/indextopic$ => topic/indextopicdetail-<id> => topic/detailactortype/<id>-<page?> => actor/typeactortype/<id> => actor/typeactor-<page?> => actor/indexactor$ => actor/indexactordetail-<id> => actor/detailactorshow/<id>-<area?>-<blood?>-<by?>-<letter?>-<level?>-<order?>-<page?>-<sex?>-<starsign?> => actor/showactorsearch/<wd?>-<area?>-<blood?>-<by?>-<letter?>-<level?>-<order?>-<page?>-<sex?>-<starsign?> => actor/searchrole-<page?> => role/indexrole$ => role/indexroledetail-<id> => role/detailroleshow/<by?>-<letter?>-<level?>-<order?>-<page?>-<rid?> => role/showwebsitetype/<id>-<page?> => website/typewebsitetype/<id> => website/typewebsite-<page?> => website/indexwebsite$ => website/indexwebsitedetail-<id> => website/detailwebsiteshow/<id>-<area?>-<by?>-<class?>-<lang?>-<letter?>-<level?>-<order?>-<page?>-<tag?> => website/showwebsitesearch/<wd?>-<area?>-<by?>-<class?>-<lang?>-<letter?>-<level?>-<order?>-<page?>-<tag?> => website/searchvodtype/<id>-<page?> => vod/typevodtype/<id> => vod/typevoddetail/<id> => vod/detailvodrss-<id> => vod/rssvodplay/<id>-<sid>-<nid> => vod/playvoddown/<id>-<sid>-<nid> => vod/downvodshow/<id>-<area?>-<by?>-<class?>-<lang?>-<letter?>-<level?>-<order?>-<page?>-<state?>-<tag?>-<year?> => vod/showvodsearch/<wd?>-<actor?>-<area?>-<by?>-<class?>-<director?>-<lang?>-<letter?>-<level?>-<order?>-<page?>-<state?>-<tag?>-<year?> => vod/searcharttype/<id>-<page?> => art/typearttype/<id> => art/typeartshow-<id> => art/showartdetail-<id>-<page?> => art/detailartdetail-<id> => art/detailartrss-<id>-<page> => art/rssartshow/<id>-<by?>-<class?>-<level?>-<letter?>-<order?>-<page?>-<tag?> => art/showartsearch/<wd?>-<by?>-<class?>-<level?>-<letter?>-<order?>-<page?>-<tag?> => art/searchlabel-<file> => label/index
新聞熱點
疑難解答