Can I use Google sitemap.php instead of .xml?

I wrote a script in PHP that creates an XML sitemap. It has a text / xml header and displays an XML structure. Can I upload this sitemap.php file to Google or do I need the .xml extension?

+4
source share
1 answer

Check out http://www.sitemaps.org/ .

All rules are defined here.

Example: see

All you need is a URL, and then declare this URL as a sitemap.

There is no .xml requirement in the protocol itself.

Usually it is placed in the root directory as http://example.com/sitemap.xml , but read the help documentation for all the details, you do not need it, there may be good reasons not to do this, and the location of the Sitemap has consequences about this content. So it’s better to read and chew it to find the best solution for what you are trying to do.

+2
source

Source: https://habr.com/ru/post/1432433/


All Articles