angular - 我的 Angular 7 应用程序 sitemap.xml 没有被网站管理员工具拾取

标签 angular angular6 angular7 google-search-console

网站站长工具未选取我的 Angular 7 应用程序 sitemap.xml

我有这个 sitemap.xml 文件(我隐藏了真实姓名):

<?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">

  <url>
    <loc>https://mywebsite.co.uk/</loc>
    <lastmod>2018-11-28T13:11:30+00:00</lastmod>
  </url>

</urlset>

在网站管理员工具中我不断收到此错误:

Your Sitemap appears to be an HTML page. Please use a supported sitemap format instead.

但我的文件是 .xml 文件。 所以我有点困惑。

最佳答案

这与 Angular 有什么关系? XML 周围有 HTML 吗?

https://mywebsite.co.uk/sitemap.xml 上应该有 XML

从我的网站之一复制示例:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://mywebsite.co.uk/</loc>
    <changefreq>weekly</changefreq>
    <priority>1</priority>
  </url>
</urlset>

关于angular - 我的 Angular 7 应用程序 sitemap.xml 没有被网站管理员工具拾取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53851106/

相关文章:

javascript - angular2在html中输出对象值而不指定对象名称

angular - 在 Angular 6 中如何使不区分大小写的 url 模式?

Angular universal 7 不进行 http 调用

javascript - 如何将变量从一个函数传递到 Angular 6中同一组件.ts中的另一个函数

node.js - 在 typescript 中使用带有 Angular 6 的 Node 短 ID 模块

javascript - 检测移动用户和桌面用户是否相同

angular - 无法解析应用程序模块 : (? 的所有参数。在语法错误(compiler.js :1021) site:stackoverflow. com

javascript - FormArray的使用和动态添加控件行

angular - ts 找不到模块 '@angular/platform-browser' ;

angular - 我如何使用 Angular2 连接 TypeScript 文件,例如 Rails Assets :precompile?