织梦园模板网提供云优cms模板,pbootcms模板,Wordpress主题模板等各类企业新闻资讯网站模板下载服务。织梦园网站模板交流群
用户名:
密码:
注册
注册后享受折扣价

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

织梦园模板 / 2018-02-05 / 收藏

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 这个上面

相关安装使用

收缩