POST TIME:2018-08-14 15:13
dedecms網站地圖的默認路徑是/data/sitemap.html 我覺得有點兒長,給一個如何修改網站地圖的路徑達到更理想的效果的方法。
打開/dede/makehtml_map.php,找到
if($dopost=="site")
{
$murl = $cfg_cmspath."/data/sitemap.html";
$tmpfile = $cfg_basedir.$cfg_templets_dir."/plus/sitemap.htm";
}
把上面的代碼修改為:
if($dopost=="site")
{
$murl = $cfg_cmspath."/sitemap.html";
$tmpfile = $cfg_basedir.$cfg_templets_dir."/plus/sitemap.htm";
}
在根目錄下建一個空文件夾,取名為sitemap(或者其他名字),然后把上面的代碼修改為:
if($dopost=="site")
{
$murl = $cfg_cmspath."/sitemap/index.html";
$tmpfile = $cfg_basedir.$cfg_templets_dir."/plus/sitemap.htm";
}
另外,我們要做到滿意的狀態,我們還需要修改sitemap的模板,即/templets/plus/sitemap.htm,以及/include/sitemap.class.php 這一個文件。