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

一、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="^(.*)/$" 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="^(.*)/([0-9]+).html$" ignoreCase="false" />
                    <action type="Rewrite" url="/plus/view.php?aid={R:2}" appendQueryString="false" />
                </rule>
                <rule name="文章分页">
                    <match url="^(.*)/([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 ^(.*)/$ /plus/list.php?tid=$1
#列表栏目分页
RewriteRule ^(.*)/list_([0-9]+)_([0-9]+)\.html$ /plus/list.php?tid=$2&PageNo=$3
#文章页
RewriteRule ^(.*)/([0-9]+)\.html$ /plus/view.php?aid=$2
#文章页分页
RewriteRule ^(.*)/([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 ^/(.*)/$ /plus/list.php?tid=$1;
	#列表栏目分页
	rewrite ^/(.*)/list_([0-9]+)_([0-9]+)\.html$ /plus/list.php?tid=$1&PageNo=$2;
	#文章页
	rewrite ^/(.*)/([0-9]+)\.html$ /plus/view.php?aid=$1;
	#文章页分页
	rewrite ^/(.*)/([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;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

永远的WEB小白

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值