xml - 为什么我的站点地图文件被认为是空的?

标签 xml web seo sitemap robots.txt

我的网站根目录中有一个 robots.txt 文件,其中包含这一行:

Sitemap: http://www.awardwinnersonly.com/sitemap.xml

sitemap.xml 也位于站点的根目录中,并包含以下文本:

<?xml version="1.0" encoding="UTF-8"?>
-<urlset xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>http://www.awardwinnersonly.com</loc>
    <lastmod>2013-09-16</lastmod>
    <changefreq>weekly</changefreq>
    <priority>1.0</priority>
  </url>
  <url>
    <loc>http://www.awardwinnersonly.com/getHugos.cshtml</loc>
    <lastmod>2013-09-16</lastmod>
    <changefreq>weekly</changefreq>
    <priority>.7</priority>
    <loc>http://www.awardwinnersonly.com/Content/pulitzers2.json</loc>
    <lastmod>2013-09-16</lastmod>
    <changefreq>monthly</changefreq>
    <priority>.7</priority>
    . . .
      <loc>http://www.awardwinnersonly.com/Content/goldenglobes.json</loc>
      <lastmod>2013-09-16</lastmod>
      <changefreq>monthly</changefreq>
      <priority>.7</priority>
    </url>
</urlset>

然而,在 [重新] 发布我的网站并尝试导航到 http://www.awardwinnersonly.com/sitemap.xml 之后,我得到:

This page contains the following errors:

error on line 2 at column 1: Document is empty
Below is a rendering of the page up to the first error.

(下面什么都没有显示 - 它或多或少是“死亡白屏”。)

我的 xml 文件、robots 文件有什么问题,或者我将如何解决这个问题?

最佳答案

看起来像一个迷路的 - 进入了你的文件。

$ curl -v http://www.awardwinnersonly.com/sitemap.xml


<?xml version="1.0" encoding="UTF-8"?>
-<urlset xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

关于xml - 为什么我的站点地图文件被认为是空的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18839926/

相关文章:

python - Flaskr Unicode 解码错误

redirect - 如何对基于 Ajax 的 URL 使用元刷新?

html - Google Rich Snippets 为一位作者工作,但不为另一位作者工作

javascript - SAPUI5 : Process Flow control is not working on different language setting

mysql - 我如何通过 t-sql 从 URL 读取多个 xml 值

c# - 从 xml 文档解码 base64 编码的数据

php - 我如何修改我的 .htaccess 以使其按我的意愿工作?

Android 数据绑定(bind) SetSupportActionBar

javascript - 通过 jQuery 添加事件到新创建的 DOM 元素

web - 具有凭据和 "essentially"任何来源的跨源资源共享