首页 > CMS > 织梦DEDE > 正文

Dedecms织梦tag链接伪静态的设置

2024-07-12 08:37:11
字体:
来源:转载
供稿:网友
dedecms织梦tag链接伪静态的设置
原本的tag链接类似于: http://www.dede58.com/tags.php?/织梦/ http://www.dede58.com/tags.php?/mysql/ 但是从seo的角度来看,我希望  吧链接修改为 http://www.dede58.com/tags/MySQL/ http://www.dede58.com/tags/织梦/  。 修改了两个文件: 【1】 、/include/taglib/tag.lib.php 大概在87行将 $row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/";   修改为 $row['link'] = $cfg_cmsurl."/tags/".urlencode($row['keyword'])."/";   【2】、/include/arc.taglist.class.php 大概在457行将 $purl = $this->GetCurUrl(); $purl .= "?/".urlencode($this->Tag);   将修改为: $purl = "/tags/".urlencode($this->Tag);   然后就是设置伪静态: apache主机: RewriteRule ^tags/.html$ tags/.php RewriteRule ^tags/(.*)/$ tags.php?/$1 RewriteRule ^tags/(.*)/([0-9]+)/$ tags.php?/$1/$2/   Nginx主机: rewrite "^/tags/.html$" /tags/.php last; rewrite "^/tags/(.*)/$" /tags.php?/$1/ last; rewrite "^/tags/(.*)/([0-9]+)/$" /tags.php?/$1/$2/ last;
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表