為了讓網站域名獲得高權重,我們經常需要去掉域名后跟隨的index.html或者index.htm等后綴,例如當我們輸入www.survivalescaperooms.com可以打開網站,但是輸入www.survivalescaperooms.com/index.html也可以打開網站,這樣也會影響到網站的權重,所以在網站中可以使用兩種方法去掉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}打開需要修改的文件:include/channelunit.func.php
找到
if($isdefault==-1)
在前面加入
//跳轉網址if($ispart>2){return $typedir;}if($defaultname == 'index.html'){$defaultname = '';}其中的index.html看您的實際情況換成index.html或者index.htm。
以上就是織夢導航鏈接index.html去除的方法總結的全部內容,希望對大家的學習和解決疑問有所幫助,也希望大家多多支持武林網。新聞熱點
疑難解答