您的位置:首页   >   网站建设知识   >   DEDE(织梦程序)内容URL命名为拼音

DEDE(织梦程序)内容URL命名为拼音

日期:UPTATED:2014-02-18 | 1385 | TAG:

再次提醒:本文针对DEDE(织梦程序)内容URL命名为拼音.html

首先在后台栏目的高级选项中修改文章的命名规则:

  • /{pinyin}.html ——文章标题.html
  • /{pinyin}/—— /文章标题/

再次修改

修改 include/helpers/channelunit.helper.php中的:

$articleRule = str_replace(‘{pinyin}’,GetPinyin($title).’_’.$aid,$articleRule);
$articleRule = str_replace(‘{py}’,GetPinyin($title,1).’_’.$aid,$articleRule);

两行为:

$articleRule = str_replace(‘{pinyin}’,GetPinyin($title),$articleRule);
$articleRule = str_replace(‘{py}’,GetPinyin($title,1),$articleRule);

去掉  .’_’.$aid

补充说明:

对于SEO来讲,友好的URL结构有助于爬虫程序更好的了解网站内容,也有利于用户对内容的判定,这在以前的“SEOer.com/url-seo.htm" rel="external nofollow" style="color: rgb(0, 119, 187); text-decoration: none;">URL结构对SEO优化的影响”中都有写到。

随着网站内容的不断增加,传统意义上的扁平URL貌似对网站管理人员带了不小的影响:

  • abc.com/1.html
  • … …
  • abc.com/100000.html

网站根目录的文件会越来越多,这时候我们在不改变URL的情况下对网页进行伪静态处理,或许会让网站管理员轻松很多,再则,如果我们当初就选择具有一定物理结构的URL规划呢,个人觉得会更好一些。

  • abc.com/mulu/mulu-1.html
  • abc.html/mulu2/mulu2-1.html
  • … …

本文作者:勾正运佳(QQ:10326943)