问题
I have a robots.txt file in the root of my site which has this one line in it:
Sitemap: http://www.awardwinnersonly.com/sitemap.xml
The sitemap.xml is also in the root of the site, and contains this text:
<?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>
Yet, after [re]publishing my site, and trying to navigate to http://www.awardwinnersonly.com/sitemap.xml, I get:
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.
(nothing is shown below that - it is more-or-less a "white screen of death.")
What is wrong with either my xml file, robots file, or how I'm going about this?
回答1:
Looks like a stray -
got into your file.
$ 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">
来源:https://stackoverflow.com/questions/18839926/why-is-my-sitemap-file-considered-empty