飞驰天下 發表於 2024-4-4 00:00:00

dedecms伪静态设置以及目录链接301跳转实现方法(伪静态)

<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <strong>htaccess伪静态的规则</strong></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        通过htaccess使用伪静态,则必须空间商支持Rewrite模块,该模块负责URL的重写。否则即便是设置好了,也无法使用,并且还有可能出现500错误。</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        下面是dedecms的伪静态设置文本(部分参考):</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        个性化伪静态还需要配合修改dedecms后台文件才能实现</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        效果为www.***.com/plus/view.php?aid=123转化为www.***.com/html/123/123.html</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        具体规则大家可以根据自己的需要进行修改!</p>
<div class="jb51code" style='margin: 0px; padding: 0px; outline: none; line-height: 25.2px; font-size: 14px; width: 660px; overflow: hidden; clear: both; font-family: tahoma, arial, "Microsoft YaHei";'>
        <pre class="brush:plain;">
RewriteEngine On
RewriteRule ^category/list-(+)\.html$ /plus/list.php?tid=$1
RewriteRule ^category/list-(+)-(+)-(+)\.html$ /plus/list.php?tid=$1&amp;totalresult=$2&amp;PageNo=$3
RewriteRule ^archives/view-(+)-(+)\.html$ /plus/view.php?arcID=$1&amp;pageno=$2
RewriteRule ^plus/list-(+).html$ /plus/list.php?tid=$1   
RewriteRule ^plus/list-(+)-(+)-(+).html$ /plus/list.php?tid=$1&amp;totalresult=$2&amp;PageNo=$3   
RewriteRule ^plus/view-(+)-1.html$ /plus/view.php?arcID=$1   
RewriteRule ^plus/view-(+)-(+).html$ /plus/view.php?aid=$1&amp;pageno=$2//个性化伪静态文章链接
RewriteRule ^list_(+)-(+)-(+).html$ list.php?tid=$1&amp;TotalResult=$2&amp;PageNo=$3
RewriteRule ^html/(+)(+)/(+).html$ /plus/view.php?aid=$3
</pre>
</div>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        5.目录和文章链接的301跳转</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        该功能可以实现网站目录链接和文章链接的301跳转</p>
<div class="jb51code" style='margin: 0px; padding: 0px; outline: none; line-height: 25.2px; font-size: 14px; width: 660px; overflow: hidden; clear: both; font-family: tahoma, arial, "Microsoft YaHei";'>
        <pre class="brush:xhtml;">
RewriteEngine On
RewriteBase /
RewriteRule ^html/it/(.+)$ https://www.***.com/html/$1 </pre>
</div>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        效果是:访问www.***.com/html/it/*.html 会跳转到www.***.com/html/.html 这个上面</p>
頁: [1]
查看完整版本: dedecms伪静态设置以及目录链接301跳转实现方法(伪静态)