Reputation: 145
I've written a script in PHP that generates a XML sitemap. It has a text/xml header and outputs a XML structure. Can I upload this sitemap.php file to Google or is it required to have a .xml extension?
Upvotes: 5
Views: 4875
Reputation: 1575
Check out http://www.sitemaps.org/.
All rules are defined here.
Exemplary see:
All you need is an URL, then announce that URL as your sitemap.
There is no .xml
requirement in the protocol itself.
It's common to place it at the root as http://example.com/sitemap.xml
, but read the reference documentation for all details, you're not required to, there can be good reason to not do so and the location of the sitemap file has implications about it's contents. So better read and chew a bit on it to find the best solution for what you're trying to do.
Upvotes: 2