What should be the name of the sitemap file for Google SEO?

旧街凉风 提交于 2019-11-27 08:40:42

问题


I created a sitemap for my website that contains the below code:

<?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>http://www.example.com/</loc>
</url>
<url>
  <loc>http://www.example.com/aboutus.html</loc>
</url>
<url>
  <loc>http://www.example.com/contactus.html</loc>
</url>
<url>
  <loc>http://www.example.com/careers.html</loc>
</url>
<url>
  <loc>http://www.example.com/terms.html</loc>
</url>
</urlset>

My doubt is that what should be the name of the file that contains this code so that Google could find my sitemap file?


回答1:


basically the site map file name is if XML then /sitemap.xml

but its not any issue if you use any other name but we have to add this to webmaster.




回答2:


There is no fixed name/location defined.

You can tell search engines where your sitemap is located by

  • linking it from your robots.txt,
  • sending an HTTP request to each search engine, or
  • submitting it to each search engine.

Of course the easiest way is to include the URL in your robots.txt, as you only have to do this one time, instead of contacting each search engine separately. And note that not only search engines are interested in your sitemap, so including it in your robots.txt allows other consumers to find it also.

Simply add this line, containing the full URL to your sitemap, in your robots.txt:

Sitemap: http://www.example.com/your-sitemap-file.xml


来源:https://stackoverflow.com/questions/30748059/what-should-be-the-name-of-the-sitemap-file-for-google-seo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!