很多人在以discuz門戶頁面為首頁時,利用站長的seo工具查詢網站的關鍵詞和描述時,怎么都是顯示“首頁”二字,遇到這類問題是直接影響網站的優化的,如果不及時解決的話,后果很嚴重哦。即使你是使用我們無憂的獨立IP空間也無濟于事,那么這個問題該如何解決呢?A5小編給您支招。
這里我們需要對Discuz程序文件中的代碼進行小修改,操作步驟如下:
文件路徑:./template/default/common/header_common.htm
修改文件:header_common.htm
把這個文件,通過FTP工具**到本地,用高級記事本打開編輯修改,找到如下代碼:
<meta name="keywords" content="{if !empty($metakeywords)}{echo htmlspecialchars($metakeywords)}{/if}" />
<meta name="description" content="{if !empty($metadescription)}{echo htmlspecialchars($metadescription)} {/if},$_G['setting']['bbname']" />
修改為:
<meta name="keywords" content="{if ''==strstr( $_G['setting']['seokeywords']['portal'])} $_G['setting']['seokeywords']['portal'] {/if}" />
<meta name="description" content="{if ''==strstr($_G['setting']['seodescription']['portal'])} $_G['setting']['seodescription']['portal'] {/if}" />
修改完代碼,保存以后,上傳到PHP空間上,然后在Discuz網站后臺工具處更新緩存,就可以看到了。
此文由 網站目錄_網站網址收錄與提交入口 編輯,未經允許不得轉載!: