服务器 Gind.cn

服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器

从Apache转移到nginx后,在站点地图中的<head />

我有一个名为http://www.domain.com/sitemap1.php的网站地图。 它从这个代码开始: <?php echo '<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://www.weddingpages.nl/sitemap.xsl"?><urlset 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/09/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> '; 从Apache转移到Nginx后,Google网站pipe理员工具开始拒绝我的站点地图告诉我他们看起来像HTML页面。 看着输出,我看到一些奇怪的东西。 使用Nginx: <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://www.weddingpages.nl/sitemap.xsl"?><head/><urlset 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/09/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> 使用Apache: <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://www.weddingpages.nl/sitemap.xsl"?><urlset 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/09/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> 由于某种原因,我不明白Nginx的投入 <head/> 在urlset之前。 有人知道这个的原因吗? 恐怕这是导致问题的原因。 但即使search,我没有find答案。