最新消息:伪静态技术大全博客开通啦!再也不为伪静态东奔西走!更多问题可以反映给博主:野狼,QQ1615241386 QQ交流群:112696646

永易搜CMS系统伪静态规则

永易搜CMS因为是目前市面上比较好的建站系统,对SEO特别好。永易搜科技对于网站的静态化、目录化、百度数据对接做的相当到位,伪静态规则因为在发展阶段,所以变化也比较大,主要是3.0版本之后的规则和之前的规则变化比较大。

一、3.0版本以前的伪静态规则如下:

httpd.conf伪静态文件
RegistrationName=Longshui Chen
RegistrationCode=7Z3NU-7MAP5-JZDPH-PR9GK
[ISAPI_Rewrite]
CacheClockRate 3600
RepeatLimit 32
#请在下面加入自己的代码;若两条规则同时符合某链接,以先出现的规则为准
RewriteRule /index.html$ /index.php [I]
RewriteRule /([a-zA-Z0-9/]+)/([0-9]+).html$ /article.php?path=$1/$2.html [I]
#栏目页面排除
RewriteCond $1 !^(admin|yysAdmin|yysadmin|yelangbak|phpMyAdmin|s)
RewriteRule /([a-zA-Z0-9/]+)/$ /list.php?path=$1 [I]
RewriteRule /([a-zA-Z0-9/]+)/list_([0-9]+).html$ /list.php?path=$1&p=$2 [I]
RewriteRule /sitemap.xml$ /sitemap.xml.php [I]

web.config伪静态文件
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<remove name="php_5.2" />
<remove name="php_5.3" />
<remove name="php_5.4" />
<remove name="php_5.5" />
<remove name="php_5.6" />
<remove name="php_7.0" />
<remove name="php_7.1" />
<add name="php_5.2" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="XXX:XXXXXXXXphp5.2php-cgi.exe" resourceType="Unspecified" requireAccess="Script" />
</handlers>
<rewrite>
<rules>
<rule name="r1">
<match url="^(s/)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="search.php" appendQueryString="true" />
</rule>
<rule name="r2">
<match url="^(tag/.+|tag)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="tag.php?path={R:1}" appendQueryString="false" />
</rule>
<rule name="r3">
<match url="^(tag/.+)/list_([0-9]+).html$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="tag.php?path={R:1}&amp;p={R:2}" appendQueryString="false" />
</rule>
<rule name="r4">
<match url="^([a-zA-Z0-9/_]+)/list_([0-9]+).html$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="list.php?path={R:1}&amp;p={R:2}" appendQueryString="false" />
</rule>
<rule name="r5">
<match url="^([a-zA-Z0-9/_]+)/([a-z0-9-_]+).html$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="content.php?path={R:1}/{R:2}.html" appendQueryString="false" />
</rule>
<rule name="r6">
<match url="^([a-zA-Z0-9-_]+).html$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="topic.php?path={R:1}" />
</rule>
<rule name="r7">
<match url="^([a-zA-Z0-9/_]+)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="list.php?path={R:1}" appendQueryString="false" />
</rule>
<rule name="r8">
<match url="^(sitemap|rss).xml$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="api/{R:1}.xml.php" />
</rule>
<rule name="r9" stopProcessing="true">
<match url="^(upload)/([a-zA-Z0-9-_]+).(php|asp|aspx|jsp)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="false" />
</conditions>
<action type="AbortRequest" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
.htaccess格式的伪静态规则如下:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(tag/.+|tag)/$  tag.php?path=$1 [L]
RewriteRule ^(tag/.+)/list_([0-9]+).html$   tag.php?path=$1&p=$2 [L]
RewriteRule ^(s/)$ search.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9/_]+)/$  list.php?path=$1 [L]
RewriteRule ^([a-zA-Z0-9/_]+)/list_([0-9]+).html$  list.php?path=$1&p=$2 [L]
RewriteRule ^([a-zA-Z0-9/_]+)/([a-z0-9-_]+).html$  content.php?path=$1/$2.html [L]
RewriteRule ^([a-zA-Z0-9-_]+).html$ topic.php?path=$1 [L]
RewriteRule ^(sitemap|rss).xml$ api/$1.xml.php [L]
NGINX格式的伪静态规则如下(第一个规则是301的,根据需要选用):
location / {
    rewrite ^/news/(946|945|944|940|938|936|934|932|930).html$  http://www.weijingtai.org/ permanent;

    if (!-f $request_filename) {
        rewrite ^/(tag/.+|tag)/$ /tag.php?path=$1 last;
        rewrite ^/(tag/.+)/list_([0-9]+).html$ /tag.php?path=$1&p=$2 last;
        rewrite ^/s/$ /search.php last;
        rewrite ^/([a-zA-Z0-9/_]+)/$ /list.php?path=$1 last;
        rewrite ^/([a-zA-Z0-9/_]+)/list_([0-9]+).html$ /list.php?path=$1&p=$2 last;
        rewrite ^/([a-zA-Z0-9/_]+)/([a-z0-9-_]+).html$ /content.php?path=$1/$2.html last;
        rewrite ^/([a-zA-Z0-9-_]+).html$ /topic.php?path=$1 last;
        rewrite ^/(sitemap|rss).xml$ /api/$1.xml.php last;
    }

}
location ~ /.ht {
    deny all;
}
后续如果有其他版本的伪静态规则整理出来,也会贴出来供大家使用。

您必须 登录 才能发表评论!

网友最新评论 (1)

  1. 全部亲测可用,如有配置不成功的,留言给我或者加QQ1615241386
    野狼7年前 (2014-09-27)