问题描述
我正在使用 Hugo 生成我的网站,并通过将其放入手动添加一个 sitemap.xml 文件 布局/站点地图.xml。
无论我尝试使用什么 sitemap.xml 文件,当我将浏览器指向站点地图 URL https://www.examplesite.ca/sitemap.xml 时,都会收到此消息。页面为空。
sitemap.xml 生成自:https://www.xml-sitemaps.com/
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com -->
<url>
<loc>https://www.examplesite.ca/</loc>
<lastmod>2021-03-25T13:24:33+00:00</lastmod>
</url>
</urlset>
解决方法
您的第一个链接存在访问问题,请确保文件 sitemap.xml 可公开访问,否则将无法呈现。 Xml 代码看起来很完美,所以很可能只是访问的问题。