位置:- 正文

dedecms织梦制作xml网站地图的方法(如何用织梦在本地搭建网站)

编辑:rootadmin

推荐整理分享dedecms织梦制作xml网站地图的方法(如何用织梦在本地搭建网站),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:织梦怎么新建页面,怎么用织梦搭建一个网站,织梦标签教程,织梦怎么建站,织梦标签教程,怎么用织梦搭建一个网站,织梦怎么建站,怎么用织梦搭建一个网站,内容如对您有帮助,希望把文章链接给更多的朋友!

在一个网站中网站地图是不能少的,有网站地图不仅可以提升网站浏览者的用户体验,还可以让蜘蛛更好的抓取网站,让网站有一个更好的收录和排名。织梦制作xml网站地图的方法步骤:

第一步:分别打开/dede/inc/inc_menu.php和/dede/inc/inc_menu_map.php文件

找到 <m:item name='更新主页HTML' link='makehtml_homepage.php' rank='sys_MakeHtml' target='main' />修改为:<m:item name='更新Sitemap' link='makehtml_sitemap.php' rank='sys_MakeHtml' target='main' />

dedecms织梦制作xml网站地图的方法(如何用织梦在本地搭建网站)

第二步:制作dede/makehtml_sitemap.php文件

拷贝一个dede/makehtml_homepage.php文件找到$pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet); $pv->SaveToHtml($homeFile);这段代码直接删除,底部修改调用生成文件模板为makehtml_sitemap.htm,然后另存为makehtml_sitemap.php,上传至dede/即可。

第三步:制作后台更新模板文件dede/templets/makehtml_sitemap.htm

拷贝一个dede/templets/makehtml_homepage.htm文件找到<input name="templet" type="text" id="templet" style="width:300″ value="<?php echo $row['templet']?>">修改为:<input name="templet" type="text" id="templet" style="width:300″ value="default/sitemap.xml">找到<td height="20″ valign="top" bgcolor="#FFFFFF"><input name="position" type="text" id="position" value="<?php echo $row['position']?>" size="30″>修改为:<td height="20″ valign="top" bgcolor="#FFFFFF"><input name="position" type="text" id="position" value="../sitemap.xml" size="30″>然后另存为makehtml_sitemap.htm,上传至dede/templets/;

第四步:制作sitemap模板文件,即templets/sitemap.xml

将一下代码保存为sitemap.xml即可<?xml version="1.0" encoding="gb2312"?><?xml-stylesheet type="text/xsl" href="/templets/css/sitemap.xsl"?><!-- generator="dedecms/3.2" --><urlset xmlns="http://www.google.com/schemas/sitemap/0.84"><url><loc>http://www.织梦58dede58.comm</loc><lastmod>{dede:arclist row=1 titlelen=30 orderby=pubdate}[field:pubdate function=strftime('%Y-%m-%d',@me)/]{/dede:arclist}</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url>{dede:channel row='30' type='top'}<url><loc>[field:typelink /]</loc><changefreq>daily</changefreq><priority>0.8</priority></url>{/dede:channel}{dede:arclist row=2000 orderby=pubdate}<url><loc>[field:arcurl/]</loc><lastmod>[field:pubdate function=strftime('%Y-%m-%d',@me)/]</lastmod><changefreq>monthly</changefreq></url>{/dede:arclist}</urlset>

免责

本文链接地址:https://www.jiuchutong.com/zhishi/310368.html 转载请保留说明!
下一篇链接:https://www.jiuchutong.com/zhishi/310369.html
免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络