帝国cms教程栏目,提供精品建站,仿站,二次开发,安装,标签使用等图文教程,帮助建设和管理好你的帝国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}&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}&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}&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]+)&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}&userid={R:2}&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+)&userid=(\w+)&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会员空间伪静态规则配置
本文永久链接地址:https://www.moyouyouw.cn/code/436.html
郑重声明:本站所有主题/文章除标明原创外,均来自网络转载,版权归原作者所有,如果有侵犯到您的权益,请联系本站删除,谢谢!我们不承担任何技术及版权问题,且不对任何资源负法律责任。
售价: 400 12 ℃ 0 评论
售价: 300 24 ℃ 0 评论
售价: 300 10 ℃ 0 评论
已有 位小伙伴发表了看法
欢迎 你 发表评论