帝国CMS伪静态方法

帝国CMS7.5默认动态页面伪静态设置,请到后台‘系统’-“系统设置”-“伪静态参数设置”里面,填写默认伪静态规则即可。设置如下图:

dad491cff1155f47f1b2cff28633c489.png

帝国CMS伪静态规则说明

附件包含结合项、.htaccess、Nginx.conf、web.config伪静态规则。

.htaccess伪静态规则RewriteEngine On

ErrorDocument 404 /404.php

Rewritebase /

#信息内容页

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^showinfo-([0-9]+)-([0-9]+)-([0-9]+).html$ /e/action/ShowInfo.php?classid=$1&id=$2&page=$3 [NC,L]

#信息列表

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^listinfo-([0-9]+)-([0-9]+).html$ /e/action/ListInfo/index.php?classid=$1&page=$2 [NC,L]

#标题分类列表页

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^infotype-([0-9]+)-([0-9]+).html$ /e/action/InfoType/index.php?ttid=$1&page=$2 [NC,L]

#TAGS信息列表页

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^tags-(etagid[0-9]+)-([0-9]+).html$ /e/tags/index.php?tagname=$1&page=$2 [NC,L]

#评论列表页

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^comment-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html$ /e/pl/index.php?doaction=$1&classid=$2&id=$3&page=$4&myorder=$5&tempid=$6 [NC,L]

#栏目自定义伪静态 默认添加.html 后缀更多的后缀自行添加

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond $1 !^(d/|e/|html/|images/|s/|search/|skin/|t/|ad/|ebak/|web/|m2/|api)

RewriteRule ^([0-9a-zA-Z-/]+)/(|index.html|index_[0-9]+.html)$ /e/action/list.php?classid=$1&page=$2 [NC,L]

#内容自定义伪静态 默认添加.html 后缀更多的后缀自行添加

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond $1 !^(d/|e/|html/|images/|s/|search/|skin/|t/|ad|ebak/|web/|m2/|api)

RewriteRule ^([0-9a-zA-Z-/]+)/([0-9a-zA-Z]+)([_0-9]*).html$ /e/action/show.php?classid=$1&id=$2&page=$3 [NC,L]

Nginx.conf伪静态规则

rewrite ^/showinfo-([0-9]+)-([0-9]+)-([0-9]+).html$ /e/action/ShowInfo.php?classid=$1&id=$2&page=$3 last;

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

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

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

rewrite ^/comment-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.+?).html$ /e/pl/index.php?doaction=$1&classid=$2&id=$3&page=$4&myorder=$5&tempid=$6 last;

if (!-f $request_filename){

set $rule_0 1$rule_0;

}

if ($request_uri !~ "^(/d/|/e/|/html/|/images/|/s/|/search/|/skin/|/t/|/ad/)"){

set $rule_0 2$rule_0;

}

if ($rule_0 = "21"){

rewrite ^/([0-9a-zA-Z-/]+)/(|index.html|index_[0-9]+.html)$ /e/action/list.php?classid=$1&page=$2 last;

rewrite ^/([0-9a-zA-Z-/]+)/([0-9a-zA-Z]+)([_0-9]*).html$ /e/action/show.php?classid=$1&id=$2&page=$3 last;

}

if (!-e $request_filename) {

return 404;

}

web.config伪静态规则

原文链接:https://blog.csdn.net/weixin_39981041/article/details/116947576?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522166669233216782412554393%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=166669233216782412554393&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-26-116947576-null-null.article_score_rank_blog&utm_term=%E5%B8%9D%E5%9B%BDcms

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注