昨天,有好幾個人問我,網站后面帶index.html會不會影響自己的網站?我覺得,少在查詢PR值時,domain/和domain/index.htm被認為是兩個不同的頁面,我的河南站長網剛開始的時候,輸入域名馬上就轉接到www.hazzw.com/index.html的,后來朋友提醒我我就更改了。
index.htm該如何去掉那?一下我給大家簡單介紹兩種方法,一種是消除欄目index.html。一種是消除網站首頁index.html
例如:www.xxxxx.com/index.html 去掉以后就變成www.xxxxx.com
第一種消除欄目index.html:
dedecms V 53_1中,如何去掉“當前位置和欄目路徑中:主頁》欄目》”連接中的index.htm
方法一在channelunit.func.php文件里第150行$sitepath = MfTypedir($sitepath);下添加如下代碼:
//導航和其他調用欄目的地址去掉index.hmtl
//導航和其他調用欄目的地址去掉index.hmtl if($ispart>2){ return $typedir; } if($defaultname == 'index.html'){ $defaultname = ''; } |
方法二
如果只去掉導航里的“index.html” 可以這樣
在模版代碼中加上紅色部分
<div class="w960 center">
<ul> <li><a href='{dede:global.cfg_cmsurl/}/'>主頁</a></li> {dede:channel function='str_replace("index.html","",@me)' type='top' currentstyle="<li class='thisclass'><a href='~typelink~'>~typename~</a> </li>"} <li><a href='[field:typeurl/]'>[field:typename/]</a></li>{/dede:channel} 學習交流
熱門圖片
猜你喜歡的新聞
新聞熱點 2024-04-27 13:35:46
2024-04-27 13:33:47
2024-04-24 22:53:44
2024-04-23 19:32:50
2024-04-23 19:25:50
2024-04-23 19:13:19
疑難解答 |