-1

I'm generating a simple XML sitemap with PHP and use a .htaccess rewrite the 'turn' that file into a .xml file. When I try to submit it to Google, Google gives me an non-descriptive error that I can't load the sitemap.

Here's the file: https://www.densediscovery.com/feed/sitemap/sitemap.xml

Does anyone have any ideas why it's not accepting it? Any other ideas for generating one (with PHP) that is acceptable?

Kai
  • 157
  • 1
  • 1
  • 9
  • What do you mean "you generate"? Do you have (A) a php script that creates the content of the xml dynamic or do you have (B) a php script that "create an xml file"? I am not sure the first option (A) would work – Thomas_krk Oct 17 '21 at 05:57
  • If Google can't access the file, it is likely a temporary problem on Google's end. Try again in a day or a week. This is going to have nothing to do with the fact that it is dynamically generated by PHP. Google has no way of knowing that is the case. – Stephen Ostermiller Oct 17 '21 at 08:24
  • 1
    I voted to close this question because general SEO questions are off-topic. Only programming-related SEO questions are acceptable on Stack Overflow. Non-programming SEO questions should be asked on [webmasters.se]. Unless Google can't read your sitemap for a couple weeks, I don't think you need to ask this question again. – Stephen Ostermiller Oct 17 '21 at 08:24

2 Answers2

0

This is probably because your webserver doesn't recognize .xml as an extension of files that should contain PHP code.

Apps Maven
  • 1,314
  • 1
  • 4
  • 17
-1

Google is not working like that, you just point to an XML file. (Not a file that changed the name to look like XML). You need a PHP that generate a file let's say myXML.xml

How to generate XML file dynamically using PHP?

Then you add the URL of myXML.xml in Google.

If it looks too complicated you can use any online tool to generate a sitemap

Thomas_krk
  • 214
  • 1
  • 8
  • Google has no way of knowing if a URL that it hits is an actual file or if it is dynamically generated by PHP on the fly. There is no reason that you have to generate an actual sitemap file. – Stephen Ostermiller Oct 18 '21 at 15:18