Sitemap doesn't work

Well, I’m going to get to the point!

My sitemap:

PS.: This is the first line: <?xml version="1.0" encoding="UTF-8"?>

It is giving me an error: Incorrect http header content-type: “text/html” (expected: “application/xml”)

Help me, pls! :slight_smile:

It should be an xml file, not a html file


I know. How do I do it?

What service are you submitting your xml file to?

One way is to rename the file extension to .xml.
If you can’t do that, copy the code, delete the file and create a new one with the same name (or different if you want) but with .xml instead of .html. Then, paste the code back in.

Most likely google. Either way, most of them require the sitemap to be in XML.

Fun fact guys, HTML is actually older than XML, although XML is a bit more general than HTML.

Google Search Console

It’s an XML file. The examples of it I saw yesterday is like this, like I made.

It is probably your apache configuration.

You should make sure you have the apache server treating xml files like xml files.

The problem is it isn’t in .html but .xml, It looks like that Google is unable to pass security system of infinityfree. (It is actually supposed to be accessible by google?)

@CarlosSantos Can you use cloudflare for your website? because it disables the security system so google crawler should be able to access your site.


Google crawler can access infinityfree perfectly. I have made a sitemap successfully on infinityfree before.

However, yes it might be infinityfree returning an error page.

How do I change it?


Ok, I’ll try it.

Well, I’ve just turned it on. What is it and what it does on my site?

Try opening devtools and navigating to that webpage on your browser. In the network requests, it should have the ability to show the content type of your page. If it’s text/html, then it will be your configuration itself.

Otherwise, it truly is infinityfree returning an error page (or something else having to do with inaccessibility).


these NS do not exist so delete them (test is here)

Also you did something nasty with redirection (301)
because your domain is redirected to www
and then to www.www.domain !

sitemap.xml I can’t retrieve and check it right now due to the problem above

1 Like

I removed those NS.

This is my .htaccess:

<files ~ “^.*.([Hh][Tt][Aa])”>
order allow,deny
deny from all
satisfy all

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ [https://www](https://www/).%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]

Options -Indexes

Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.html [NC] RewriteRule ^ %1 [R,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.html -f RewriteRule ^(.*?)/?$ $1.html [L]

Is the problem in here?

IMPORTANT: Make sure that the line RewriteEngine On is not repeated twice. In case the line already exists, simply copy the rest of the code without it.

Is that Wordpress you have up or ??

I think you can simplify everything and open an account on cloudflare

useful to read (why www ?? - there is no point )


I don’t know what I do. Now my website is going to www.www!