帝國CMS程序Apache/IIS7/Nginx環境下的偽靜態規則

在我們常用的中大型內容網站系統中,帝國CMS可能說是安全性和穩定性比較好的。DEDECMS程序雖然當初比較流行,但是也經常出現安全漏洞。相反帝國CMS的更新頻率以及安全性還是被行業內較為看好的,雖然在易用性上比DEDECMS稍微不是特別習慣,但是認真使用還是可以的。

帝國CMS支持偽靜態,在常用的Apache、IIS7、Nginx環境下的偽靜態規則,需要的時候可以直接使用。

第一、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;
if (!-e $request_filename) {
return 404;
}

第二、Apache環境下偽靜態規則

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

第三、IIS7環境下偽靜態規則

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!--帝國7.2默認規則 IIS7的rule name不能重複相同-->
<rewrite>
<rules>
<rule name="listinfo">
<match url="^(.*/)*listinfo-(.+?)-(.+?).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/e/action/ListInfo/index.php\?classid={R:2}&amp;page={R:3}" />
</rule>
<rule name="showinfo">
<match url="^(.*/)*showinfo-(.+?)-(.+?)-(.+?).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/e/action/ShowInfo.php\?classid={R:2}&amp;id={R:3}&amp;page={R:4}" />
</rule>
<rule name="infotype">
<match url="^(.*/)*infotype-(.+?)-(.+?).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/e/action/InfoType/index.php\?ttid={R:2}&amp;page={R:3}" />
</rule>
<rule name="tags">
<match url="^(.*/)*tags-(.+?)-(.+?).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/e/tags/index.php\?tagname={R:2}&amp;page={R:3}" />
</rule>
<rule name="comment">
<match url="^(.*/)*comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/e/pl/index.php\?doaction={R:2}&amp;={R:3}&amp;={R:4}&amp;page={R:5}&amp;myorder={R:6}&amp;tempid={R:7}" />
</rule>
</rules>
</rewrite>
</system.webServer> &nbsp;
</configuration>

一般情況下我們使用Nginx和Apache環境較多。

未經允許不得轉載:犄角旮旯 » 帝國CMS程序Apache/IIS7/Nginx環境下的偽靜態規則

評論列表

還木有評論 ,趕緊來一個!嘻嘻,:)

發表評論

访客的頭像

Top