下载鸥 > 网站下载 > 开发教程 > 帝国CMS

帝国CMS7.5默认伪静态规则大全(.htacces+nginx+web.config)

354 2021-03-18 16:10:31

收藏
帝国CMS7.5默认动态页面伪静态设置,请到后台系统设置 - 伪静态参数里,将需要设置伪静态的选项全部设置为默认。而后,在服务器配置如下规则。

帝国CMS7.5默认伪静态规则大全(.htacces+nginx+web.config)提供了多种服务器的伪静态,供参考。

帝国CMS7.5默认伪静态规则大全(.htacces+nginx+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伪静态规则

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpErrors errorMode="DetailedLocalOnly">
            <remove statusCode="404" />
            <error statusCode="404" path="/404.php" responseMode="ExecuteURL" />
        </httpErrors>
        <rewrite>
            <rules>
                <rule name="规则 1" stopProcessing="true">
                    <match url="^showinfo-([0-9]+)-([0-9]+)-([0-9]+).html$" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{QUERY_STRING}" pattern="^(.*)$" ignoreCase="false" />
                    </conditions>
                    <action type="Rewrite" url="/e/action/ShowInfo.php?classid={R:1}&amp;id={R:2}&amp;page={R:3}" appendQueryString="false" />
                </rule>
                <rule name="规则 2" stopProcessing="true">
                    <match url="^listinfo-([0-9]+)-([0-9]+).html$" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{QUERY_STRING}" pattern="^(.*)$" ignoreCase="false" />
                    </conditions>
                    <action type="Rewrite" url="/e/action/ListInfo/index.php?classid={R:1}&amp;page={R:2}" appendQueryString="false" />
                </rule>
                <rule name="规则 3" stopProcessing="true">
                    <match url="^infotype-([0-9]+)-([0-9]+).html$" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{QUERY_STRING}" pattern="^(.*)$" ignoreCase="false" />
                    </conditions>
                    <action type="Rewrite" url="/e/action/InfoType/index.php?ttid={R:1}&amp;page={R:2}" appendQueryString="false" />
                </rule>
                <rule name="规则 4" stopProcessing="true">
                    <match url="^tags-(etagid[0-9]+)-([0-9]+).html$" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{QUERY_STRING}" pattern="^(.*)$" ignoreCase="false" />
                    </conditions>
                    <action type="Rewrite" url="/e/tags/index.php?tagname={R:1}&amp;page={R:2}" appendQueryString="false" />
                </rule>
                <rule name="规则 5" stopProcessing="true">
                    <match url="^comment-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html$" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{QUERY_STRING}" pattern="^(.*)$" ignoreCase="false" />
                    </conditions>
                    <action type="Rewrite" url="/e/pl/index.php?doaction={R:1}&amp;classid={R:2}&amp;id={R:3}&amp;page={R:4}&amp;myorder={R:5}&amp;tempid={R:6}" appendQueryString="false" />
                </rule>
                <rule name="规则 6" stopProcessing="true">
                    <match url="^([0-9a-zA-Z-/]+)/(|index.html|index_[0-9]+.html)$" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{QUERY_STRING}" pattern="^(.*)$" ignoreCase="false" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{R:1}" pattern="^(d/|e/|html/|images/|s/|search/|skin/|t/|ad/|ebak/|web/|m2/|api)" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="/e/action/list.php?classid={R:1}&amp;page={R:2}" appendQueryString="false" />
                </rule>
                <rule name="规则 7" stopProcessing="true">
                    <match url="^([0-9a-zA-Z-/]+)/([0-9a-zA-Z]+)([_0-9]*).html$" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{QUERY_STRING}" pattern="^(.*)$" ignoreCase="false" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{R:1}" pattern="^(d/|e/|html/|images/|s/|search/|skin/|t/|ad|ebak/|web/|m2/|api)" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="/e/action/show.php?classid={R:1}&amp;id={R:2}&amp;page={R:3}" appendQueryString="false" />
                </rule>
            </rules>
        </rewrite>
        <httpRedirect enabled="false" />
    </system.webServer>
</configuration>

 

本文地址:https://xzo.com.cn/develop/empire/721.html

有帮助,很赞!

信息来源:下载鸥
信息标签
导出教程 下载word版教程
发表评论 共有条评论
关于帝国CMS


帝国cms是一款功能极为强大的cms程序,性能强悍、安全性高,可轻松支持10万数据,高级开发人员可制作出能容纳千万数据量的网站,是国内最出色的开源cms程序之一,推荐企业用户使用

当前最新版本为7.5,8.0版本即将上线,新版本的核心优化点在于多终端的适配。

推荐帝国CMS开发教程
织梦CMS与帝国CMS有什么不同?
织梦CMS与帝国CMS有什么不同?

织梦是我用过的第二个CMS,也是最喜欢的CMS之一。他最大的优点有二:1、功能十...

15 925
帝国CMS留言板怎样增加字段?
帝国CMS留言板怎样增加字段?

网站留言板是用户留存的重要环节,但帝国cms自带的留言板功能十分单一,大多数...

1 296
帝国CMS怎样修改首页模板?
帝国CMS怎样修改首页模板?

网站在运营过程中难免要进行小小的修修改改,此时如果找人就比较麻烦,自己改试...

1 249
帝国CMS精准像素美化版怎样修改网站名
帝国CMS精准像素美化版怎样修改网站名

帝国CMS官方默认后台挺难看的,如果自用还可以,给客户则可能让客户怀疑你的审...

1 322
帝国CMS列表页面list.var怎样将年月日时间分开调用?
帝国CMS列表页面list.var怎样将年月日时间分开调用?

很多时候,出于美观或者个性化的需求,我们需要将帝国cms的发布时间切割为年月...

7 803
帝国cms怎样判断会员是否登录的状态?
帝国cms怎样判断会员是否登录的状态?

许多站点需要做帝国cms会员投稿的功能,不仅可以借此盈利,还能有效促进seo排名...

0 284
帝国cms防火墙拦截会员投稿关键词无效怎么办?
帝国cms防火墙拦截会员投稿关键词无效怎么办?

帝国cms拦截关键词可以在用户投稿输入指定关键词后进行拦截,并变成白屏。功...

3 313
帝国cms根据关键词调用相关文章,每个关键词调用4条
帝国cms根据关键词调用相关文章,每个关键词调用4条

帝国cms根据关键词调用相关文章,每个关键词调用信息不超过4条,如果关键词和栏...

8 369
随机帝国CMS开发教程
帝国CMS文章怎样插入短视频?
帝国CMS文章怎样插入短视频?

在这个短视频横行的年代,我们都知道一个短视频比文章比图片都要更加具有吸引...

1 414
帝国CMS有栏目seo标题吗,在哪里设置?
帝国CMS有栏目seo标题吗,在哪里设置?

很多用惯了织梦CMS的朋友在用帝国以后就会非常困惑,因为织梦CMS他的栏目是有...

1 259
帝国CMS文章页的seo标题在哪里?
帝国CMS文章页的seo标题在哪里?

很多朋友用惯了织梦CMS,转到帝国之后就非常困惑,因为织梦CMS的文章是有一个se...

1 329
我想用帝国CMS,但我的网站是织梦的,有什么办法吗?
我想用帝国CMS,但我的网站是织梦的,有什么办法吗?

最近有客户咨询欧哥,说他已经有了一个网站,是织梦CMS做的,已经有了几千条收录,...

1 245
学习帝国cms新手买什么样的服务器入门比较好?
学习帝国cms新手买什么样的服务器入门比较好?

学习帝国cms用什么样的服务器比较好呢?其实选择有很多比如说学生机、虚拟主...

2 293
帝国CMS怎样快速入门?
帝国CMS怎样快速入门?

很多做网站的朋友想要自己学习一门CMS,要么是织梦CMS,要么呢是帝国CMS,而我们...

1 274
帝国CMS列表页为什么不是灵动标签?
帝国CMS列表页为什么不是灵动标签?

熟悉帝国的朋友可能都知道,帝国CMS列表页他有自己独立的标签,而不是使用灵动,...

1 236
帝国cms可以在录入关键词后自动同步到tag里面吗?
帝国cms可以在录入关键词后自动同步到tag里面吗?

帝国CMS7.5的文章编辑页是有关键词和tag功能的,如果关键词和tag一样,则录入关...

1 282
客服QQ:341553759
点击咨询 常见问题 >
官方交流群:90432500
点击加入