去掉DEDECMS去掉导航链接index.html



为什么要去掉DEDECMS导航链接里的index.html?因为去掉链接里的index.html要比后者权重高一点。


DEDECMS去掉导航链接里的index.html有两种方法:


1.修改模板内的对应标签,从而去掉对应链接的index.html.


在出现栏目链接的标签里(不局限于channe,l,list,arclist) ,只要是能调用出来栏目链接的标签都可以使用这个方法.


方法如下:


在标记内加入下面的代码


function=’str_replace(“index.htm”,””,@me)’


注意:’str_replace(“index.htm”,””,@me)’/其中的index.htm看您的实际情况换成index.html或者index.htm。


例子:


{dede:arclist  function=’str_replace(“index.htm”,””,@me)’}…底层调用{/dede:arclist}


{dede:list  function=’str_replace(“index.htm”,””,@me)’}…底层调用{/dede:list}


2.修改程序文件,一次性替换所有栏目链接的index.html.


需要修改的文件:include/channelunit.func.php


找到if($isdefault==-1)


在前面加入


//跳转网址


if($ispart>2){


return $typedir;


}


if($defaultname == ‘index.html’){


$defaultname = ”;


}


注意:其中的index.html看您的实际情况换成index.html或者index.htm


修改完成后,然后重新生成即可.