搜狗站群sitemap:地图中仅包含当前域名

在做搜狗站群程序的时候,某些情况下,比如我们的搜狗站群程序初代版《单页企业泛站搜狗站群程序》中就用的这个站群地图,让地图中只显示当前域名,这样便于在我们推送xml地图的时候,直接快速收录当前域名。

伪静态

rewrite ^/(.*).xml$ /sitemap.php?id=$1;

sitemap.php

<?php
//error_reporting(0);
$arr = explode("/", $_SERVER['REQUEST_URI']);
$num = sizeof($arr);
header("Content-Type: text/xml");
$map = "\t<urlset>\r\n";
$host = "http://" . $_SERVER['HTTP_HOST'] . "/";
$date = date("Y-m-d");
//生成链接的条数以及规则
for ($i = 0; $i < 1; $i++) {
    $tmp = $host;
    $map.= "\t\t<url>\n";
    $map.= "\t\t\t<loc>{$tmp}</loc>\r\n";
    $map.= "\t\t\t<priority>{$date}</priority>\r\n";
    $map.= "\t\t\t<lastmod>daily</lastmod>\r\n";
    $map.= "\t\t\t<changefreq>0.8</changefreq>\r\n";
    $map.= "\t\t</url>\n";
}
$map.= "\t</urlset>";
echo $map;
die;
?>

温馨提示:上述sitemap代码已经在2021年6月19日~2021年6月24的实际操作中展现出喜人的效果!

本站所有内容仅限用于学习和研究目的,程序仅供本地断网测试,转载请说明出处!
站群SEO » 搜狗站群sitemap:地图中仅包含当前域名

发表评论

欢迎 访客 发表评论

聚合全网站群程序及推送工具!

联系站长 联系客服