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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With