帝国模板之家为广大用户提供专业、一站式建站服务。

帝国cms教程

帝国cms教程栏目,提供精品建站,仿站,二次开发,安装,标签使用等图文教程,帮助建设和管理好你的帝国cms站点。

当前位置:首页 > 教程 > 帝国cms教程 > 正文

帝国cms会员空间伪静态规则配置

帝国模板之家 2020-09-07 帝国cms教程 评论

帝国cms会员空间都是以动态链接的形式访问,这样很容易猜到我们网站是用帝国cms做的,如果网站有某些漏洞,很容易被攻击。其次动态链接对网站的优化也是不利的。今天,帝国模板之家小编就给大家分享一下帝国cms会员空间配置伪静态规则的方法。

Apache伪静态规则:

RewriteEngine On 
RewriteRule wb/([0-9]+).html$ /e/space/?userid=$1&r=1 [L] 
RewriteRule wb/([0-9]+).html$ /e/space/index.php?userid=$1&r=1 [L] 
RewriteRule wb/info/([0-9]+).html$ e/space/UserInfo.php?userid=$1 [L] 
RewriteRule wb/lx/([0-9]+).html$ e/space/feedback.php?userid=$1 [L] 
RewriteRule wb/news/([0-9]+).html$ e/space/list.php?userid=$1&mid=1 [L] 
RewriteRule wb/news/([0-9]+)/([0-9]+).html$ e/space/list.php?page=$1&userid=$2&mid=1 [L] 
RewriteRule wb/contact/([0-9]+).html$ e/space/gbook.php?userid=$1 [L] 
RewriteRule tag/([0-9]+).html$ e/tags/?tagid=$1 [L] 
ErrorDocument 404 /error/404.php 

IIS7.5伪静态规则:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <outboundRules>
                <preConditions>
                    <preCondition name="ResponseIsHtml1">
                        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                    </preCondition>
                </preConditions>
            </outboundRules>
            <rules>
                <clear />
                <rule name="会员空间首页" stopProcessing="true">
                    <match url="^wb/([0-9]+).html$" ignoreCase="false" />
                    <action type="Rewrite" url="/e/space/?userid={R:1}&amp;r=1" appendQueryString="false" />
                </rule>
                <rule name="会员空间首页动态跳静态" stopProcessing="true">
                    <match url="^e/space/?$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{QUERY_STRING}" pattern="^userid=([0-9]+)$" />
                    </conditions>
                    <action type="Redirect" url="/wb/{C:1}.html" appendQueryString="false" redirectType="Permanent" />
                </rule>
                <rule name="会员空间首页1" stopProcessing="true">
                    <match url="^wb/([0-9]+).html$" ignoreCase="false" />
                    <action type="Rewrite" url="/e/space/index.php?userid={R:1}&amp;r=1" appendQueryString="false" />
                </rule>
                <rule name="会员空间首页动态跳静态1" stopProcessing="true">
                    <match url="^e/space/index.php?$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{QUERY_STRING}" pattern="^userid=([0-9]+)$" />
                    </conditions>
                    <action type="Redirect" url="/wb/{C:1}.html" appendQueryString="false" redirectType="Permanent" />
                </rule>
                <rule name="公司介绍" stopProcessing="true">
                    <match url="^wb/info/([0-9]+).html$" ignoreCase="false" />
                    <action type="Rewrite" url="e/space/UserInfo.php?userid={R:1}" appendQueryString="false" />
                </rule>
                <rule name="公司介绍动态跳静态" stopProcessing="true">
                    <match url="^e/space/UserInfo.php?$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{QUERY_STRING}" pattern="^userid=([0-9]+)$" />
                    </conditions>
                    <action type="Redirect" url="/wb/info/{C:1}.html" appendQueryString="false" redirectType="Permanent" />
                </rule>
                <rule name="联系我们" stopProcessing="true">
                    <match url="^wb/lx/([0-9]+).html$" ignoreCase="false" />
                    <action type="Rewrite" url="e/space/feedback.php?userid={R:1}" appendQueryString="false" />
                </rule>
                <rule name="联系我们动态跳静态" stopProcessing="true">
                    <match url="^e/space/feedback.php?$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{QUERY_STRING}" pattern="^userid=([0-9]+)$" />
                    </conditions>
                    <action type="Redirect" url="/wb/lx/{C:1}.html" appendQueryString="false" redirectType="Permanent" />
                </rule>
                <rule name="公司观点" stopProcessing="true">
                    <match url="^wb/news/([0-9]+).html$" ignoreCase="false" />
                    <action type="Rewrite" url="e/space/list.php?userid={R:1}&amp;mid=1" appendQueryString="false" />
                </rule>
                <rule name="公司观点动态跳静态" stopProcessing="true">
                    <match url="^e/space/list.php?$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{QUERY_STRING}" pattern="^userid=([0-9]+)&amp;mid=([0-9]+)$" />
                    </conditions>
                    <action type="Redirect" url="/wb/news/{C:1}.html" appendQueryString="false" redirectType="Permanent" />
                </rule>
                <rule name="公司观点1" stopProcessing="true">
                    <match url="^wb/news/([0-9]+)/([0-9]+).html$" ignoreCase="false" />
                    <action type="Rewrite" url="e/space/list.php?page={R:1}&amp;userid={R:2}&amp;mid=1" appendQueryString="true" />
                </rule>
                <rule name="公司观点动态跳静态1" stopProcessing="true">
                    <match url="^e/space/list.php?$" ignoreCase="true" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{QUERY_STRING}" pattern="^page=(\w+)&amp;userid=(\w+)&amp;mid=(\w+)$" />
                    </conditions>
                    <action type="Redirect" url="/wb/news/{C:1}/{C:2}.html" appendQueryString="false" redirectType="Permanent" />
                </rule>
                <rule name="会员空间联系方式" stopProcessing="true">
                    <match url="^wb/contact/([0-9]+).html$" ignoreCase="false" />
                    <action type="Rewrite" url="e/space/gbook.php?userid={R:1}" appendQueryString="false" />
                </rule>
                <rule name="会员空间联系方式动态跳静态" stopProcessing="true">
                    <match url="^e/space/gbook.php?$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{QUERY_STRING}" pattern="^userid=([0-9]+)$" />
                    </conditions>
                    <action type="Redirect" url="/wb/contact/{C:1}.html" appendQueryString="false" redirectType="Permanent" />
                </rule>
                <rule name="tag" stopProcessing="true">
                    <match url="^tag/([0-9]+).html$" ignoreCase="false" />
                    <action type="Rewrite" url="e/tags/?tagid={R:1}" appendQueryString="true" />
                </rule>
                <rule name="tag动态跳静态" stopProcessing="true">
                    <match url="^e/tags?" ignoreCase="true" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{QUERY_STRING}" pattern="^tagid=([0-9]+)$" />
                    </conditions>
                    <action type="Redirect" url="/tag/{C:1}.html" appendQueryString="false" redirectType="Permanent" />
                </rule>
            </rules>
        </rewrite>
        <httpErrors>
            <remove statusCode="404" subStatusCode="-1" />
            <error statusCode="404" prefixLanguageFilePath="" path="/error/404.php" responseMode="ExecuteURL" />
        </httpErrors>
    </system.webServer>
</configuration>

Nginx伪静态规则:

rewrite 'wb/([0-9]+).html' /e/space/?userid=$1&r=1 last; 
rewrite 'wb/([0-9]+).html' /e/space/index.php?userid=$1&r=1 last; 
rewrite 'wb/info/([0-9]+).html' e/space/UserInfo.php?userid=$1 last; 
rewrite 'wb/lx/([0-9]+).html' e/space/feedback.php?userid=$1 last; 
rewrite 'wb/news/([0-9]+).html' e/space/list.php?userid=$1&mid=1 last; 
rewrite 'wb/news/([0-9]+)/([0-9]+).html' e/space/list.php?page=$1&userid=$2&mid=1 last; 
rewrite 'wb/contact/([0-9]+).html' e/space/gbook.php?userid=$1 last; 
rewrite 'tag/([0-9]+).html' e/tags/?tagid=$1 last; 

以上就是帝国cms会员空间伪静态规则配置方法,更多相关内容请关注帝国模板之家其他文章。

认为总有一天可以做成的事,不如从现在开始就着手,因为只要有开始,相信成功才会近一步。

已有 位小伙伴发表了看法

欢迎 发表评论

  • 匿名发表

关于

帝国cms模板

网页插件

帝国模板之家 | www.moyouyouw.cn

本站所有模板/文章除标明原创外,均来自网络转载,版权归原作者所有,如果有侵犯到您的权益,请联系站长删除,谢谢! 寻找帝国cms模板首选帝国模板之家,用心做站,上线至今广受好评,值得信赖!

  • 交流群1:帝国cms交流群1
  • 交流群2:帝国cms交流群2
在线QQ 给我留言