织梦(dede)在调用栏目链接时,默认是不带index.html。但是有时候去购买的模板中,无论你怎么调用都是带index.html。不管是从个人习惯还是对搜索引擎的友好度来到,栏目链接上带有index.html都是不好的,那么如何去除导航栏目链接后面的index.html呢?探狐给您提供两种方法,希望对您有所帮助。
第一种方法:修改模板内的对应标签
在出现栏目链接的标签里(不局限于channe,l,list,arclist),只要是能调用出来栏目链接的标签都可以使用这个方法:
在标记内加入下面的代码
function='str_replace("index.html","",@me)'
注意:'str_replace("index.html","",@me)'/其中的index.html看您的实际情况换成index.html或者index.htm。
例子:
{dede:arclistfunction='str_replace("index.html","",@me)'}...底层调用{/dede:arclist}
{dede:listfunction='str_replace("index.html","",@me)'}...底层调用{/dede:list}
第二种方法:修改程序文件,一次性替换所有栏目链接的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

本站文章禁止转载,违者必究: 一个专注SEO/SEM网络营销推广教程的自媒体