网页特效代码_站长素材站移动版

DeDecms教程

主页 > CMS教程 > DeDecms教程 >

iis/apache/nginx/环境下dedecms织梦伪静态规则

一、iis环境下织梦伪静态规则 web.config 文件
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="首页">
                    <match url="^index.html$" ignoreCase="false" />
                    <action type="Rewrite" url="index.php" appendQueryString="false" />
                </rule>
				<rule name="tag首页">
					<match url="^tags.html$" ignoreCase="false" />
					<action type="Rewrite" url="tags.php" appendQueryString="false" />
				</rule>
				<rule name="tag列表">
					<match url="^tags/([0-9]+).html$" ignoreCase="false" />
					<action type="Rewrite" url="/tags.php?/{R:1}" appendQueryString="false" />
				</rule>
				<rule name="tag列表最后有左斜杠">
					<match url="^tags/([0-9]+).html$" ignoreCase="false" />
					<action type="Rewrite" url="/tags.php?/{R:1}/" appendQueryString="false" />
				</rule>
				<rule name="tag列表分页">
					<match url="^tags/([0-9]+)_([0-9]+).html$" ignoreCase="false" />
					<action type="Rewrite" url="/tags.php?/{R:1}/{R:2}" appendQueryString="false" />
				</rule>
				<rule name="tag列表分页最后有左斜杠">
					<match url="^tags/([0-9]+)_([0-9]+).html$" ignoreCase="false" />
					<action type="Rewrite" url="/tags.php?/{R:1}/{R:2}/" appendQueryString="false" />
				</rule>
                <rule name="列表">
                    <match url="^list-([0-9]+).html$" ignoreCase="false" />
                    <action type="Rewrite" url="/plus/list.php?tid={R:1}" appendQueryString="false" />
                </rule>
                <rule name="列表分页">
                    <match url="^list-([0-9]+)-([0-9]+).html$" ignoreCase="false" />
                    <action type="Rewrite" url="/plus/list.php?tid={R:2}&amp;PageNo={R:3}" appendQueryString="false" />
                </rule>
				<rule name="文章页">
                    <match url="^view-([0-9]+).html$" ignoreCase="false" />
                    <action type="Rewrite" url="/plus/view.php?aid={R:2}" appendQueryString="false" />
                </rule>
                <rule name="文章分页">
                    <match url="^view-([0-9]+)_([0-9]+).html$" ignoreCase="false" />
                    <action type="Rewrite" url="/plus/view.php?aid={R:2}&amp;pageno={R:3}" appendQueryString="false" />
                </rule>
				<rule name="搜索页分页">
                    <match url="^search/(.*)-([0-9]+).html$" ignoreCase="false" />
                    <action type="Rewrite" url="/plus/search.php?q={R:1}&amp;PageNo={R:2}&amp;pagesize=10&amp;searchtype=title" appendQueryString="false" />
                </rule>
				<rule name="搜索页">
                    <match url="^search/(.*).html$" ignoreCase="false" />
                    <action type="Rewrite" url="/plus/search.php?q={R:1}&amp;pagesize=10&amp;searchtype=title" appendQueryString="false" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>


二、apache环境下织梦网站伪静态规则 .htaccess 文件
#dedecms电脑端目录结构apache伪静态
RewriteEngine On
RewriteBase /
#首页
RewriteRule ^index\.html$ index\.php
#TAG标签
RewriteRule ^tags\.html$	tags\.php
RewriteRule ^tags/([0-9]+)\.html$	tags\.php\?\/$1 [L]
RewriteRule ^tags/([0-9]+)\.html$	tags\.php\?\/$1\/
RewriteRule ^tags/([0-9]+)_([0-9]+)\.html$	tags\.php\?\/$1\/$2
RewriteRule ^tags/([0-9]+)_([0-9]+)\.html$	tags\.php\?\/$1\/$2\/
#列表栏目
RewriteRule ^list-([0-9]+)\.html$ /plus/list.php?tid=$1
#列表栏目分页
RewriteRule ^list-([0-9]+)-([0-9]+)\.html$ /plus/list.php?tid=$2&PageNo=$3
#文章页
RewriteRule ^view-([0-9]+)\.html$ /plus/view.php?aid=$2
#文章页分页
RewriteRule ^view-([0-9]+)-([0-9]+)\.html$ /plus/view.php?aid=$2&pageno=$3
#搜索页
RewriteRule ^search/(.*)-([0-9]+)\.html$  /plus/search.php?q=$1&PageNo=$2&pagesize=10&searchtype=title
RewriteRule ^search/(.*)\.html$  /plus/search.php?q=$1&pagesize=10&searchtype=title


三、nginx环境下织梦伪静态规则 nginx.conf 文件
#把大括号{}里的代码放到你的nginx配置文件location /{}里面去
location / {
	#dedecms电脑端目录结构nginx伪静态
	#首页
	rewrite ^/index\.html$ /index.php;
	#TAG标签
	rewrite ^/tags\.html$	/tags.php;
	rewrite ^/tags/([0-9]+)\.html$	/tags.php?\/$1;
	rewrite ^/tags/([0-9]+)\.html$	/tags.php?\/$1\/;
	rewrite ^/tags/([0-9]+)_([0-9]+)\.html$	 /tags.php?\/$1\/$2;
	rewrite ^/tags/([0-9]+)_([0-9]+)\.html$  /tags.php?\/$1\/$2\/;
	#列表栏目
	rewrite ^/list-([0-9]+)\.html$ /plus/list.php?tid=$1;
	#列表栏目分页
	rewrite ^/list-([0-9]+)-([0-9]+)\.html$ /plus/list.php?tid=$1&PageNo=$2;
	#文章页
	rewrite ^/view-([0-9]+)\.html$ /plus/view.php?aid=$1;
	#文章页分页
	rewrite ^/view-([0-9]+)-([0-9]+)\.html$ /plus/view.php?aid=$1&pageno=$2;
	#搜索页
	rewrite ^/search/(.*)-([0-9]+)\.html$  /plus/search.php?q=$1&PageNo=$2&pagesize=10&searchtype=title;
	rewrite ^/search/(.*)\.html$  /plus/search.php?q=$1&pagesize=10&searchtype=title;
}
(责任编辑:admin)

    468x60