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


本文整理自网络,侵删。

htaccess伪静态的规则

通过htaccess使用伪静态,则必须空间商支持Rewrite模块,该模块负责URL的重写。否则即便是设置好了,也无法使用,并且还有可能出现500错误。

下面是dedecms的伪静态设置文本(部分参考):

个性化伪静态还需要配合修改dedecms后台文件才能实现

效果为www.***.com/plus/view.php?aid=123转化为www.***.com/html/123/123.html

具体规则大家可以根据自己的需要进行修改!

RewriteEngine On  
RewriteRule ^category/list-([0-9]+)\.html$ /plus/list.php?tid=$1  
RewriteRule ^category/list-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /plus/list.php?tid=$1&totalresult=$2&PageNo=$3  
RewriteRule ^archives/view-([0-9]+)-([0-9]+)\.html$ /plus/view.php?arcID=$1&pageno=$2  
RewriteRule ^plus/list-([0-9]+).html$ /plus/list.php?tid=$1   
RewriteRule ^plus/list-([0-9]+)-([0-9]+)-([0-9]+).html$ /plus/list.php?tid=$1&totalresult=$2&PageNo=$3   
RewriteRule ^plus/view-([0-9]+)-1.html$ /plus/view.php?arcID=$1   
RewriteRule ^plus/view-([0-9]+)-([0-9]+).html$ /plus/view.php?aid=$1&pageno=$2  //个性化伪静态文章链接  
RewriteRule ^list_([0-9]+)-([0-9]+)-([0-9]+).html$ list.php?tid=$1&TotalResult=$2&PageNo=$3  
RewriteRule ^html/([0-9]+)([0-9]+)/([0-9]+).html$ /plus/view.php?aid=$3

5.目录和文章链接的301跳转

该功能可以实现网站目录链接和文章链接的301跳转

RewriteEngine On  
RewriteBase /  
RewriteRule ^html/it/(.+)$ https://www.***.com/html/$1 [R=301,L]

效果是:访问www.***.com/html/it/*.html 会跳转到www.***.com/html/.html 这个上面


标签:织梦DedeCMS

相关阅读 >>

织梦gbkgb2312转utf-8编码操作步骤(全站修改方法)

dedecms后台:fatal errorcall to a member function read()

dedecms tag标签伪静态的修改方法

详解自己动手添加一个函数实现任意字段调用

解决dedecms(5.65.7)缩略图缩放变形问题方法

关于制作织梦的网站地图实例的示例代码

详解织梦cms自动清除文章内段落标签的调用方法

详解dedecms织梦远程图片本地化https链接图片无法本地化怎么解决

dede5.7文章图片alt自动调用文章标题的方法

dedecms 5.3网站备份该备份哪些内容

更多相关阅读请进入《织梦DedeCMS》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...