帝國(guó)CMS7.5默認(rèn)偽靜態(tài)nginx版,升級(jí)tagid偽靜態(tài)規(guī)則
2022-07-15 21:33 作者:一同V學(xué)習(xí) | 我要投稿
關(guān)于帝國(guó)CMS的偽靜態(tài)很多人不知道該怎么寫,帝國(guó)CMS由于大多是生成html靜態(tài)文件,所以建議使用nginx服務(wù)器,為了方便,偽靜態(tài)也自然會(huì)使用nginx的版本,帝國(guó)CMS7.5 nginx默認(rèn)規(guī)則如下:
參考:https://www.glgxt.cn/post/imperial_cms7-5_default.html
帝國(guó)CMS偽靜態(tài)nginx版:
rewrite?^([^\.]*)/listinfo-(.+?)-(.+?)\.html$?$1/e/action/ListInfo/index.php?classid=$2&page=$3?last; rewrite?^([^\.]*)/showinfo-(.+?)-(.+?)-(.+?)\.html$?$1/e/action/ShowInfo.php?classid=$2&id=$3&page=$4?last; rewrite?^([^\.]*)/infotype-(.+?)-(.+?)\.html$?$1/e/action/InfoType/index.php?ttid=$2&page=$3?last; rewrite?^([^\.]*)/tags-(.+?)-(.+?)\.html$?$1/e/tags/index.php?tagname=$2&page=$3?last; rewrite?^([^\.]*)/comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)\.html$?$1/e/pl/index\.php\?doaction=$2&classid=$3&id=$4&page=$5&myorder=$6&tempid=$7?last; rewrite?^/sitemap.xml?/sitemap.php; rewrite?^/sitemap-([0-9]+).xml?/sitemap.php?classid=$1; if?(!-e?$request_filename)?{ return?404; }
上面是帝國(guó)CMS默認(rèn)的nginx偽靜態(tài)寫法,從帝國(guó)CMS7.5起,支持Tagsid功能,也就是以前的tagname改成了tagid,讓更喜歡id風(fēng)格的網(wǎng)友滿意了,如果你使用tagid,那么你的偽靜態(tài)規(guī)則需要做以下修改:
rewrite?^([^\.]*)/tags-(.+?)-(.+?)\.html$?$1/e/tags/index.php?tagname=$2&page=$3?last;
改成下面這個(gè)樣子
rewrite?^([^\.]*)/tags-(.+?)-(.+?)\.html$?$1/e/tags/index.php?tagid=$2&page=$3?last;
最后將修改好的偽靜態(tài)規(guī)則保存到服務(wù)器
偽靜態(tài)規(guī)則使用方法
這里以寶塔面板為例子:
點(diǎn)擊對(duì)應(yīng)站點(diǎn)的設(shè)置按鈕
點(diǎn)擊左側(cè)偽靜態(tài)
將偽靜態(tài)規(guī)則復(fù)制到右側(cè)
標(biāo)簽: