• 设为首页
  • 收藏本站
  • 积分充值
  • VIP赞助
  • 手机版
  • 微博
  • 微信
    微信公众号 添加方式:
    1:搜索微信号(888888
    2:扫描左侧二维码
  • 快捷导航
    福建二哥 门户 查看主题

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

    发布者: 404号房间 | 发布时间: 2025-7-24 17:21| 查看数: 40| 评论数: 0|帖子模式

            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&ageNo=$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&ageNo=$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&ageNo=$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 这个上面

    来源:互联网
    免责声明:如果侵犯了您的权益,请联系站长(1277306191@qq.com),我们会及时删除侵权内容,谢谢合作!

    最新评论

    QQ Archiver 手机版 小黑屋 福建二哥 ( 闽ICP备2022004717号|闽公网安备35052402000345号 )

    Powered by Discuz! X3.5 © 2001-2023

    快速回复 返回顶部 返回列表