我的angular 7 apps sitemap.xml未被网站管理员工具拾取
我的angular 7 apps sitemap.xml未被网站管理员工具拾取 我有这个sitemap.xml文件(我隐藏了真实姓名):我的angular 7 apps sitemap.xml未被网站管理员工具拾取,angular,angular6,angular7,google-webmaster-tools,Angular,Angular6,Angular7,Google Webmaster Tools,我的angular 7 apps 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:schemaLocat
<?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>
https://mywebsite.co.uk/
2018-11-28813:11:30+00:00
在网站管理员工具中,我经常遇到这样的错误:
<?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>
您的站点地图显示为HTML页面。请使用受支持的
而不是站点地图格式
但是我的文件是一个.xml文件。
所以我有点困惑。这和角度有什么关系?XML周围有HTML吗 应该只在上有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>
https://mywebsite.co.uk/
每周的
1.
以下是angular 2+版本的解决方案:
步骤1:在src/或src/资产下创建或添加sitemap.xml。添加url路径,如示例链接所示
步骤2:在angular.json文件中添加以下条目
第3步:运行angular应用程序,现在您可以通过/Sitemap.xml访问它
步骤4:部署更改并访问域/assets/sitemap.xml中的sitemap.xml
(注意:您也可以将sitemap.xml文件设置到src文件夹中)
看起来google找不到angular 7应用程序的my sitemap.xml。您需要在angular routing中创建sitemap.xml路由吗?不,您只需要在其中放置一个静态xml文件。如果您使用的是Angular CLI,您必须确保在example.com/sitemap.xml上提供它,请参阅本教程:感谢您提供的链接-非常好-看起来我需要更新Angular json资产数组-我将进行测试now@AngularM你把这个问题整理好了吗?在URL中键入sitemap.xml时,我可以看到它,但Google仍然给我一个
无法获取错误。