Here is the code:

<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://site.ru/</loc> </url> </urlset> 

Encoding: UTF-8

There are no errors in sitemap.xml, but Yandex gives out: Ошибка HTTP . This means that the http status is not equal to 200. I checked that my status is 304 (Not Modified) . But how to fix it?

  • one
    304 means that the data is taken from the cache. Delete the cache in the browser and see the 200 status. - EatMyDust pm

2 answers 2

The question currently does not specify the full information in order to give an answer.

The fact is that web servers (nginx, httpd, iis) in the default configuration do not cache static files such as gif, jpeg, txt, css, xml and many others.

What is your web server - is unclear. How exactly you set it up to cache the static is also unclear. If so, then we need configs to understand where not so done.

There may even be very exotic cases where sitemap.xml may not be an xml file, but a script that generates a similar file on the fly from the database and then you need to deal not with the web server settings, but watch the script code, which headers and what conditions do you fulfill.

  • I have a regular hosting. On other sites works (200). Even if everything is removed and sitemap.xml is left, it is all the same 304 - Ilnyr
  • @Ilnyr ordinary hosting is just like ordinary powder in advertising. Everyone talks about him, but no one has seen it. Then give a link to your site, we'll figure it out - FeroxTL
  • Here is a link to the sitemap: iske-elmet.ru/sitemap.xml - Ilnyr pm
  • Judging by the responses of the web server you have installed nginx + varnish. Tell me - is it your own "regular" hosting (i.e., you can show the nginx and varnish config files) or is it a commercial hosting and you can not provide configs? Judging by the line v07.hostline.ru I suspect that the second is most likely true (you are not an employee, but their client) - then it is more logical for you to contact the provider’s technical support. At first glance, the xml file is fine: 200 OK is given on the first access, with the next 304 Not Modified. - AK
  • Plus, for every fire case, we’ll clarify that sitemap.xml is not a script, but a static file. So? - AK

Your server is configured to cache static files, most likely including xml files. To fix the situation, you need to know which web server and on which system you are using. If Nginx, then look at the files nginx.conf , /etc/nginx/sites-available , for the desired site you are looking for rules for static files, something like this: location ~* ^.+.(html|jpg|jpeg|gif|css|png|js|ico|gz|xml)$ { , you can read more about setting up nginx caching here . Delete file extensions that are not needed to be cached, and reload nginx settings: # nginx -s reload If you use Apache , then we look at .htaccess in the root of the site, the configs files from conf-avialiable and conf.d We are looking for something like:

 <IfModule mod_expires.c> <FilesMatch ".(jpg|jpeg|png|gif|swf|css|js|xml)$"> ExpiresDefault A604800 Header set Cache-Control "max-age=604800, public" </FilesMatch> </IfModule> 

Remove the xml from the list of extensions and restart Apache. If you use some kind of server control panel, then we look at the settings there.