很多用DEDECMS做站的朋友,為避免將data目錄內(nèi)的東西隨便外泄,在robots中將data目錄屏蔽了,但是DEDE默認(rèn)的網(wǎng)站地圖 卻是在 data下,屏蔽掉這個(gè)文件夾的話搜索引擎就無(wú)法抓取到網(wǎng)站地圖,這不利于SEO優(yōu)化,那么有沒(méi)有好的方法呢,讓DEDE生成的網(wǎng)站地圖放在系統(tǒng)根目錄下面?下面我就給大家介紹一下DEDE網(wǎng)站地圖優(yōu)化方法.
1、首先在網(wǎng)站根目錄下建立rss文件夾
2、修改/dede/makehtml_map.php文件
將代碼:$cfg_cmspath."/data/sitemap.html"; 修改為:$cfg_cmspath."/sitemap.html";
將代碼:$cfg_cmspath."/data/rssmap.html"; 修改為:$cfg_cmspath."/rssmap.html";
3、修改/include/arc.rssview.class.php文件將代碼:$murl = $GLOBALS['cfg_cmspath']."/data/rss/".$this->TypeID.".xml";
修改為:$murl = $GLOBALS['cfg_cmspath']."/rss/".$this->TypeID.".xml";
4、修改/include/sitemap.class.php文件
將以下內(nèi)容:
$typelink = $GLOBALS['cfg_cmsurl']."/data/rss/".$row->id.".xml";
修改為:$typelink = $GLOBALS['cfg_cmsurl']."/rss/".$row->id.".xml";
此時(shí)再到網(wǎng)站后臺(tái)生成網(wǎng)站地圖的時(shí)候,就會(huì)直接生成到網(wǎng)站根目錄了.
新聞熱點(diǎn)
疑難解答
圖片精選