DEDECMS5.3去掉導(dǎo)航鏈接里的index.html_DedeCms教程

      編輯Tag賺U幣
      教程Tag:暫無Tag,歡迎添加,賺取U幣!

      為什么要去掉導(dǎo)航鏈接里的index.html?

      雖然說這兩個(gè)鏈接的意思一樣,鏈接到的網(wǎng)址也一樣,但是從優(yōu)化角度來說去掉鏈接里的index.html要比后者權(quán)重高一點(diǎn)。

      DEDECMS去掉導(dǎo)航鏈接里的index.html有兩種方法:

      1.修改模板內(nèi)的對(duì)應(yīng)標(biāo)簽,從而去掉對(duì)應(yīng)鏈接的index.html.

      在出現(xiàn)欄目鏈接的標(biāo)簽里(不局限于channe,l,list,arclist) ,只要是能調(diào)用出來欄目鏈接的標(biāo)簽都可以使用這個(gè)方法.

      方法如下:
      在標(biāo)記內(nèi)加入下面的代碼

      function='str_replace("index.htm","",@me)'

      注意:'str_replace("index.htm","",@me)'/其中的index.htm看您的實(shí)際情況換成index.html或者index.htm。

      例子:

      {dede:arclist  function='str_replace("index.htm","",@me)'}...底層調(diào)用{/dede:arclist}
      {dede:list  function='str_replace("index.htm","",@me)'}...底層調(diào)用{/dede:list}

      2.修改程序文件,一次性替換所有欄目鏈接的index.html.

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

      找到if($isdefault==-1)

      在前面加入

      //跳轉(zhuǎn)網(wǎng)址
      if($ispart>2){
        return $typedir;
      }

      if($defaultname == 'index.html'){
        $defaultname = '';
      }

      注意:其中的index.html看您的實(shí)際情況換成index.html或者index.htm

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

      模板無憂原創(chuàng),更多DEDEcms教程.

      查看更多 DedeCms教程  織夢(mèng)模板  織夢(mèng)DedeCms視頻教程  織夢(mèng)dedecms專題

      來源:模板無憂//所屬分類:DedeCms教程/更新時(shí)間:2009-05-19
      相關(guān)DedeCms教程