Yoast seo ошибка sitemap

My sitemap is not using the URL format. For example, it does not include/exclude www or has HTTP instead of HTTPS. The sitemap uses the same protocol as the WordPress Site URL. Go to Admin > Settings > General and change the site URLs to the correct protocol. If you have recently switched your URL format, you may have incorrectly formatted URLs in your database. Please backup your database and complete a search and replace the old with the new format. My sitemap is a white page or a header with no URLs. Your XSLT file is unavailable, the XML is invalid, or the “Do not process 404 errors for static objects with WordPress” setting is checked in W3 Total Cache. Check this page to see which error applies to you, and fix it accordingly. My sitemap doesn’t work on an Apache server. Most likely, you haven’t implemented our rewrite rules. This article has more advice on troubleshooting the sitemaps on Apache servers: Yoast XML Sitemaps on Apache servers My sitemap doesn’t work on an NGINX server. Most likely, you haven’t implemented our rewrite rules. This article has more advice on troubleshooting the sitemaps on NGINX servers: Yoast XML Sitemaps on NGINX servers My plugin won’t create a sitemap. The settings of your permalinks aren’t properly saved. Go to WordPress ‘Settings’ in the backend Go to ‘Permalinks’ Click ‘Save Changes’ (without altering anything) The sitemap has gray links. This is how we built it. Gray links in your sitemap identify recently visited URLs in your own browser. Google does not see the browser formatting as they retrieve the XML source code. Learn more in this article about gray links in sitemaps. My new videos are at the bottom of my second sitemap. This is how we built it. This way only the last video sitemap changes and Google only needs to re-fetch that one instead of re-fetching all the video sitemaps all the time. The last update time will tell Google what’s new. My sitemap does not update. Sometimes the cache functionality on your site prevents the sitemap from updating automatically.  This article has more advice on how to tackle this issue: Sitemap does not update. I don’t see an individual page in my sitemap. There are multiple reasons an individual page may be missing from the XML sitemap:
1. You have set the page (or the whole post type) to noindex.
2. The page’s canonical URL is set to a different URL.
3. The page was redirected to another URL by Yoast SEO Premium.
4. If it’s the news sitemap, the page has not been published within the past 48 hours. 1. To check if an individual page is set to noindex, go to the Advanced tab in the Yoast SEO metabox or sidebar, and make sure you allow search engines to show the page in the search results. To check the settings for the whole content type/taxonomy, go to the Advanced settings in Yoast SEO and ensure you are not blocking search engines from accessing your content. 
2. To check if the page’s canonical URL is set to a different URL, use the URL inspection tool and follow Google’s guidelines on consolidating duplicate URLs.
3. If you are using Yoast SEO premium, check if the page was redirected to another URL in Yoast’s redirect manager.

Перейти к содержимому

Yoast SEO

В этой небольшой записи, я бы хотел рассказать вам как исправить распространенную ошибку от плагина Yoast SEO. 

Есть три основных решения этой ошибки:

  1. Зайдите в «Настройки» -> «Постоянные ссылки» и нажмите «Сохранить изменения». Иногда WordPress не сразу обновляет ссылки, поэтому этот простой способ может помочь обновить все ссылки на сайте.
  2. Проверьте наличие записей, тегов или категорий на вашем сайте. Если у вас их нет, то этот может повлечь за собой 404 ошибку. Так же зайдите в «SEO» -> «XML Карта Сайта» -> и проверьте в поле «Функциональность XML-карты сайта» должно быть «Enabled». Если нет, то выберите «Enabled» и сохраните изменения.
  3. Это решение описано ниже, но оно различается исходя из того на чём работает ваш сайт (Apache или Nginx).

Apache

Для Apache вам нужно добавить код, который написан ниже. Его нужно добавить в .htaccess файл в корне вашего сайта. Самое главное напишите это перед всем другим кодом, который там есть.

# Yoast SEO - XML Sitemap Rewrite Fix
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
# END Yoast SEO - XML Sitemap Rewrite Fix

Nginx

Для Nginx решение следующее:

#Yoast sitemap
location ~ ([^/]*)sitemap(.*).x(m|s)l$ {
        ## this redirects sitemap.xml to /sitemap_index.xml
  rewrite ^/sitemap.xml$ /sitemap_index.xml permanent;
        ## this makes the XML sitemaps work
        rewrite ^/([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 last;
  rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
  rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
        ## The following lines are optional for the premium extensions
  ## News SEO
        rewrite ^/news-sitemap.xml$ /index.php?sitemap=wpseo_news last;
  ## Local SEO
  rewrite ^/locations.kml$ /index.php?sitemap=wpseo_local_kml last;
  rewrite ^/geo-sitemap.xml$ /index.php?sitemap=wpseo_local last;
  ## Video SEO
  rewrite ^/video-sitemap.xsl$ /index.php?xsl=video last;
}

Если у вас сервер, то вы так же можете перезапустить Nginx сервис — sudo service nginx restart и потом посмотреть изменения.

Послесловие

Если у вас до сих пор показывается ошибка, то вы можете написать под этой записью и я вам постараюсь помочь. А в целом, одно из решений выше вам точно должно помочь, так как других причин для появления 404 ошибки нет.

Источник

  • Yoast официальная статья

Об авторе

Ошибка 404 в карте сайта, в основном означает, что карта сайта не существует по целому ряду причин которые решаются следующими способами:

  1. Сброс структуры  ссылок –  распространенный способоб решения проблемы с ошибкой 404.  Переходим в Admin панель > Настройки> Постоянные ссылки и нажимаем  кнопку сохранить, не изменяя ничего. ( Мне помог данный способ )
  2. Убедитесь , что записи или страницы существуют для того, чтобы создать карту сайта.

Чтобы сделать карту сайта в плагине yoast достаточно перейти в  SEO -> XML карта сайта и нажать  сохранить изменения.

yoast seo

yoast seo – создание карты сайта

Если вы при переходе по ссылке карты,  видите белый экран, то это особенность хостинга, обычно, проблем с яндексом и гуглом не возникает. Они такую карту видят.

Проверить карту можно исходным кодом.

Адрес карты  будет site.ru/sitemap_index.xml

Обязательно укажите его в robots.txt

Viewing 15 replies — 1 through 15 (of 15 total)

  • Can you first confirm that the XML Sitemaps feature is enabled in the pugin In order to enable sitemaps in the Yoast SEO plugin, you would need to perform the following actions:

      ​In WordPress go to SEO>General>Features
      ​Toggle the ‘XML Sitemaps’ option to ‘On’
      ​Click ‘Save Changes’

    If you have confirmed that sitemaps are enabled and you are still receiving a 404 error at sitemap_index.xml, the error can be caused by a number of issues, including the permalinks or rewrite rules. We would first recommend to try resetting the permalink structure in WordPress which can be done by performing the following steps:

      In WordPress, go to Settings>Permalinks
      Clicking ‘Save Changes’ without making any modifications

    ​We also have additional information regarding the sitemap files creating an error here: https://kb.yoast.com/kb/my-sitemap-index-is-giving-a-404-error-what-should-i-do/

    If you continue to receive the error after resetting the permalinks, we would then also suggest adding a set of rewrite rules to your server and we have a guide on adding these for an Apache servers here: https://kb.yoast.com/kb/xml-sitemaps-apache/ and for Nginx servers here: https://kb.yoast.com/kb/xml-sitemaps-nginx/.

    Thread Starter
    Javier

    (@vaporlibre)

    I did all the steps, but the same thing still happens to me, It doesn’t give me a 404 error, it simply redirects me to my homepage, what can I do?

    • This reply was modified 2 years, 10 months ago by Javier.

    Hi,

    We can see that the redirect from the Yoast sitemaps https://vaporlibre.com/sitemap_index.xml to the homepage is coming from the server. We suggest contacting your host provider and verifying that the server is correctly configured and no rules exist which are resulting in that behavior.

    Thread Starter
    Javier

    (@vaporlibre)

    I checked the entire server, hired an informatic, I also talked to the administrators of the server and everything is correct, they say it is a plugin problem, reading in the forums I have seen that this happens to many people too.

    Hi,

    We are not sure why the Yoast sitemaps are failing to appear. But it now sounds like a plugin or theme conflict. Can you try and gather as much information for us as possible? Please perform the following:

    1. Make sure you are using the most recent WordPress Core, v5.3.2. If you are not sure what version you have or how to update, your host provider can help. Also, be sure to update your Yoast to v13.2 and update your non-Yoast plugins.

    2. Please Check for conflicts.

    If there is a conflict with a plugin or a theme, you can create a new GitHub issue for our developers. Please report the issue to a third party developer as well.

    If you didn’t find any conflicts or errors, we think the issue is specific to your site. We’d need to investigate further but are unable to do so on these forums. You can purchase Yoast SEO Premium and receive our Premium email support and we can help you further.

    Thread Starter
    Javier

    (@vaporlibre)

    I checked all that he told me, nothing works. Previously it worked correctly, it was in an update when it stopped working.
    How do you want me to buy the premium version, if the free one doesn’t work?

    Yoast SEO sitemaps can be loaded using two URLs, the pretty permalink one and a non-pretty permalink.

    Pretty Permalink: https://www.example.com/sitemap_index.xml
    Non-Pretty Permalink: https://www.example.com/?sitemap=1

    The pretty permalink redirects to the homepage. Please check any redirect plugins you may have and remove redirects that are causing this redirect.

    The non-pretty permalink returns an error XML declaration allowed only at the start of the document. Multiple blank line appear in the source code of the sitemap and is due to a conflict with something in your setup. Usually, there is an empty space or a blank line before or after the closing PHP opening or closing tag, which shouldn’t be there.

    You can narrow down the exact source of conflict by performing a conflict check. Once you have identified whether your theme or a plugin causes the issue, please contact the developers of that theme or plugin for assistance in finding and removing the whitespace.

    Test this on your development or staging site, if you have one. If not, we recommend using the Health Check & Troubleshooting plugin. This plugin allows you to run a conflict check without affecting normal visitors to your site.

    As we can imagine that you’re unfamiliar with checking for conflicts, we’d like to point you to a step-by-step guide that will walk you through the process: How to check for plugin conflicts.

    All URLs which end with ‘xml’ redirect to front page:

    $ curl -i https://vaporlibre.com/sitemapblablablablaxml
    HTTP/1.1 301 Moved Permanently
    Server: nginx
    ...
    X-Powered-By: PHP/7.3.15
    X-Redirect-By: WordPress
    ...
    

    If you can’t find PHP code or a plugin then you can try to use https://github.com/stracker-phil/wp-debug-redirect. It’ll show debug trace in HTTP headers.

    Other issue is white-space:

    $ curl -i https://vaporlibre.com/?sitemap=1
    HTTP/1.1 200 OK
    Server: nginx
    Content-Type: text/xml; charset=UTF-8
    ...
    X-Powered-By: PleskLin
    
    <?xml version="1.0" ...
    

    There are 4 empty lines before the content. You should find them into the code or plugins. I think that the theme isn’t source of the white-space.

    Thread Starter
    Javier

    (@vaporlibre)

    How can I remove those 4 blanks, I have reviewed all the plugins, and all the files in my root, but nothing.
    The problem is that the document is not created on my server to modify it.

    I still see redirects…

    Yoast SEO generates sitemaps “on the fly” and there aren’t physical XML files. You can’t just open XML file and remove lines.

    Empty lines in PHP files can be located anywhere (even on the end of files). Common places are wp-config.php and functions.php.

    You should try https://yoast.com/help/how-to-check-for-plugin-conflicts/ You should open two tabs (admin dashboard and sitemap) in the browser. At second tab (sitemap) try to force refresh (ctrl-f5) at each activation/deactivation of plugin.

    If you aren’t familiar with this process then you can see video – https://givewp.com/documentation/resources/troubleshoot-wordpress-websites-health-check/

    Thread Starter
    Javier

    (@vaporlibre)

    I managed to remove all the spaces, now the file is seen correctly.
    But I have another problem, it tells me that the file has html tag.
    And the url doesn’t work:
    https://vaporlibre.com/sitemap.xml
    neither is it
    https://vaporlibre.com/sitemap_index.xml
    In these urls I am redirected to my home page.
    Only this works: https://vaporlibre.com/?sitemap=1
    But google doesn’t want it, it tells me that the sitemaps have html tags.

    You can’t submit last URL because it includes sub-sitemaps which are redirecting to front page. It could be reason why google detect sitemaps as html.

    You should use previous procedure for check conflict to detect from where redirects coming. If you can then upload redirect.php (from previous comment) to plugins directory, activate this plugin and check network tab in browner console. I’m pretty sure that redirects are in WP (based on HTTP headers).

    Thread Starter
    Javier

    (@vaporlibre)

    I can’t find it, how can I detect the origin of the redirects?

    You can use the plugin https://github.com/stracker-phil/wp-debug-redirect to debug redirects. After activate this plugin, you will find debug stack-trace in HTTP headers. Other way is plugin conflict check.

    Based on current HTTP headers, it seems that sitemaps are redirecting by standard WP functions and I think that you can find it with wp-debug-redirect.

    It’s possible that you can add rewrite rules in .htaccess – https://yoast.com/help/xml-sitemaps-apache/. It may work because redirects are doing in later phase…

    Plugin Support
    Jerlyn

    (@jerparx)

    Closed. No further questions.

  • Viewing 15 replies — 1 through 15 (of 15 total)

    Viewing 15 replies — 1 through 15 (of 15 total)

  • Can you first confirm that the XML Sitemaps feature is enabled in the pugin In order to enable sitemaps in the Yoast SEO plugin, you would need to perform the following actions:

      ​In WordPress go to SEO>General>Features
      ​Toggle the ‘XML Sitemaps’ option to ‘On’
      ​Click ‘Save Changes’

    If you have confirmed that sitemaps are enabled and you are still receiving a 404 error at sitemap_index.xml, the error can be caused by a number of issues, including the permalinks or rewrite rules. We would first recommend to try resetting the permalink structure in WordPress which can be done by performing the following steps:

      In WordPress, go to Settings>Permalinks
      Clicking ‘Save Changes’ without making any modifications

    ​We also have additional information regarding the sitemap files creating an error here: https://kb.yoast.com/kb/my-sitemap-index-is-giving-a-404-error-what-should-i-do/

    If you continue to receive the error after resetting the permalinks, we would then also suggest adding a set of rewrite rules to your server and we have a guide on adding these for an Apache servers here: https://kb.yoast.com/kb/xml-sitemaps-apache/ and for Nginx servers here: https://kb.yoast.com/kb/xml-sitemaps-nginx/.

    Thread Starter
    Javier

    (@vaporlibre)

    I did all the steps, but the same thing still happens to me, It doesn’t give me a 404 error, it simply redirects me to my homepage, what can I do?

    • This reply was modified 2 years, 10 months ago by Javier.

    Hi,

    We can see that the redirect from the Yoast sitemaps https://vaporlibre.com/sitemap_index.xml to the homepage is coming from the server. We suggest contacting your host provider and verifying that the server is correctly configured and no rules exist which are resulting in that behavior.

    Thread Starter
    Javier

    (@vaporlibre)

    I checked the entire server, hired an informatic, I also talked to the administrators of the server and everything is correct, they say it is a plugin problem, reading in the forums I have seen that this happens to many people too.

    Hi,

    We are not sure why the Yoast sitemaps are failing to appear. But it now sounds like a plugin or theme conflict. Can you try and gather as much information for us as possible? Please perform the following:

    1. Make sure you are using the most recent WordPress Core, v5.3.2. If you are not sure what version you have or how to update, your host provider can help. Also, be sure to update your Yoast to v13.2 and update your non-Yoast plugins.

    2. Please Check for conflicts.

    If there is a conflict with a plugin or a theme, you can create a new GitHub issue for our developers. Please report the issue to a third party developer as well.

    If you didn’t find any conflicts or errors, we think the issue is specific to your site. We’d need to investigate further but are unable to do so on these forums. You can purchase Yoast SEO Premium and receive our Premium email support and we can help you further.

    Thread Starter
    Javier

    (@vaporlibre)

    I checked all that he told me, nothing works. Previously it worked correctly, it was in an update when it stopped working.
    How do you want me to buy the premium version, if the free one doesn’t work?

    Yoast SEO sitemaps can be loaded using two URLs, the pretty permalink one and a non-pretty permalink.

    Pretty Permalink: https://www.example.com/sitemap_index.xml
    Non-Pretty Permalink: https://www.example.com/?sitemap=1

    The pretty permalink redirects to the homepage. Please check any redirect plugins you may have and remove redirects that are causing this redirect.

    The non-pretty permalink returns an error XML declaration allowed only at the start of the document. Multiple blank line appear in the source code of the sitemap and is due to a conflict with something in your setup. Usually, there is an empty space or a blank line before or after the closing PHP opening or closing tag, which shouldn’t be there.

    You can narrow down the exact source of conflict by performing a conflict check. Once you have identified whether your theme or a plugin causes the issue, please contact the developers of that theme or plugin for assistance in finding and removing the whitespace.

    Test this on your development or staging site, if you have one. If not, we recommend using the Health Check & Troubleshooting plugin. This plugin allows you to run a conflict check without affecting normal visitors to your site.

    As we can imagine that you’re unfamiliar with checking for conflicts, we’d like to point you to a step-by-step guide that will walk you through the process: How to check for plugin conflicts.

    All URLs which end with ‘xml’ redirect to front page:

    $ curl -i https://vaporlibre.com/sitemapblablablablaxml
    HTTP/1.1 301 Moved Permanently
    Server: nginx
    ...
    X-Powered-By: PHP/7.3.15
    X-Redirect-By: WordPress
    ...
    

    If you can’t find PHP code or a plugin then you can try to use https://github.com/stracker-phil/wp-debug-redirect. It’ll show debug trace in HTTP headers.

    Other issue is white-space:

    $ curl -i https://vaporlibre.com/?sitemap=1
    HTTP/1.1 200 OK
    Server: nginx
    Content-Type: text/xml; charset=UTF-8
    ...
    X-Powered-By: PleskLin
    
    <?xml version="1.0" ...
    

    There are 4 empty lines before the content. You should find them into the code or plugins. I think that the theme isn’t source of the white-space.

    Thread Starter
    Javier

    (@vaporlibre)

    How can I remove those 4 blanks, I have reviewed all the plugins, and all the files in my root, but nothing.
    The problem is that the document is not created on my server to modify it.

    I still see redirects…

    Yoast SEO generates sitemaps “on the fly” and there aren’t physical XML files. You can’t just open XML file and remove lines.

    Empty lines in PHP files can be located anywhere (even on the end of files). Common places are wp-config.php and functions.php.

    You should try https://yoast.com/help/how-to-check-for-plugin-conflicts/ You should open two tabs (admin dashboard and sitemap) in the browser. At second tab (sitemap) try to force refresh (ctrl-f5) at each activation/deactivation of plugin.

    If you aren’t familiar with this process then you can see video – https://givewp.com/documentation/resources/troubleshoot-wordpress-websites-health-check/

    Thread Starter
    Javier

    (@vaporlibre)

    I managed to remove all the spaces, now the file is seen correctly.
    But I have another problem, it tells me that the file has html tag.
    And the url doesn’t work:
    https://vaporlibre.com/sitemap.xml
    neither is it
    https://vaporlibre.com/sitemap_index.xml
    In these urls I am redirected to my home page.
    Only this works: https://vaporlibre.com/?sitemap=1
    But google doesn’t want it, it tells me that the sitemaps have html tags.

    You can’t submit last URL because it includes sub-sitemaps which are redirecting to front page. It could be reason why google detect sitemaps as html.

    You should use previous procedure for check conflict to detect from where redirects coming. If you can then upload redirect.php (from previous comment) to plugins directory, activate this plugin and check network tab in browner console. I’m pretty sure that redirects are in WP (based on HTTP headers).

    Thread Starter
    Javier

    (@vaporlibre)

    I can’t find it, how can I detect the origin of the redirects?

    You can use the plugin https://github.com/stracker-phil/wp-debug-redirect to debug redirects. After activate this plugin, you will find debug stack-trace in HTTP headers. Other way is plugin conflict check.

    Based on current HTTP headers, it seems that sitemaps are redirecting by standard WP functions and I think that you can find it with wp-debug-redirect.

    It’s possible that you can add rewrite rules in .htaccess – https://yoast.com/help/xml-sitemaps-apache/. It may work because redirects are doing in later phase…

    Plugin Support
    Jerlyn

    (@jerparx)

    Closed. No further questions.

  • Viewing 15 replies — 1 through 15 (of 15 total)

    При анализе сайтов в Яндекс.Вебмастере который раз получаем вот такое предупреждение:

    Предупреждение Яндекс об ошбиках в XML sitemap

    При этом при детальном рассмотрении ошибка становится просто предупреждением, не влияющим на индексацию:

    Ошибки Яндекс с XML Sitemap Yoast SEO

    Ситуация проясняется, Яндекс не понимает дополнение image, которое присутствует в XML Sitemap.

    Лирическое отступление. Вообще-то это обычный косяк Яндекса! Само слово XML (eXtensible Markup Language — расширяемый язык разметки) изначально предполагает любые и произвольные расширения в разметке, при условии, что они делаются в другом пространстве имен. Однако разработчики Яндекса о пространствах имен XML имеют такое же представление, как слушательницы хореографических курсов о мелиорации Узбекистана.

    На большинстве наших сайтов XML Sitemap генерируется плагином Yoast SEO, который решает наши задачи более чем полно, и менять его из-за тупой ошибки обработки Яндекса нам не хотелось бы. Поэтому мы попытались найти иное решение.

    И решение было найдено. Yoast SEO, как и большая часть плагинов и дополнений к WordPress сделан с учетом архитектуры WP, то есть использует хуки WordPress, что позволяет нам контролировать поведение плагина, не вмешиваясь в программный код (вот за что мы любим WordPress). Был найден фильтр wpseo_xml_sitemap_img_src, который отвечает за формирование URL изображения и мы на него повесили простой обработчик в functions.php:

    // Уберем из карты сайта URL картинок
    add_filter( 'wpseo_xml_sitemap_img_src', 'remove_image_url' );
    function remove_image_url( $uri ) {
    return '';
    }
    

    Всё! Ссылок на изображения в XML Sitemap WordPress больше нет.

    Update. Тут предложили еще более простое решение:

    /* Remove Images From Yoast Sitemap */
    add_filter( 'wpseo_xml_sitemap_img', '__return_false' );
    

    Update 2. Написал небольшой плагин, который это делает. Получить его бесплатно можно здесь. Если не хотите возится с настройкой темы, просто установите и активируйте этот плагин.

    Update 3. июль 2017. Исправил плагин, сейчас он отключает кэш карт сайта в SEO Yoast, и явно фильтрует по регулярным выражениям элементы, которые не нравятся Яндексу. Скачиваем свежую версию плагина.

    Update 4. апрель 2019. Доработали плагин. Теперь он еще и правильно канонизирует пагинацию архивов. Подробности позже.

    Надеюсь, этот простой рецепт вам поможет.

    Перейти к содержимому

    Yoast SEO

    В этой небольшой записи, я бы хотел рассказать вам как исправить распространенную ошибку от плагина Yoast SEO. 

    Есть три основных решения этой ошибки:

    1. Зайдите в «Настройки» -> «Постоянные ссылки» и нажмите «Сохранить изменения». Иногда WordPress не сразу обновляет ссылки, поэтому этот простой способ может помочь обновить все ссылки на сайте.
    2. Проверьте наличие записей, тегов или категорий на вашем сайте. Если у вас их нет, то этот может повлечь за собой 404 ошибку. Так же зайдите в «SEO» -> «XML Карта Сайта» -> и проверьте в поле «Функциональность XML-карты сайта» должно быть «Enabled». Если нет, то выберите «Enabled» и сохраните изменения.
    3. Это решение описано ниже, но оно различается исходя из того на чём работает ваш сайт (Apache или Nginx).

    Apache

    Для Apache вам нужно добавить код, который написан ниже. Его нужно добавить в .htaccess файл в корне вашего сайта. Самое главное напишите это перед всем другим кодом, который там есть.

    # Yoast SEO - XML Sitemap Rewrite Fix
    RewriteEngine On
    RewriteBase /
    RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
    RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
    RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
    RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
    RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
    # END Yoast SEO - XML Sitemap Rewrite Fix

    Nginx

    Для Nginx решение следующее:

    #Yoast sitemap
    location ~ ([^/]*)sitemap(.*).x(m|s)l$ {
            ## this redirects sitemap.xml to /sitemap_index.xml
      rewrite ^/sitemap.xml$ /sitemap_index.xml permanent;
            ## this makes the XML sitemaps work
            rewrite ^/([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 last;
      rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
      rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
            ## The following lines are optional for the premium extensions
      ## News SEO
            rewrite ^/news-sitemap.xml$ /index.php?sitemap=wpseo_news last;
      ## Local SEO
      rewrite ^/locations.kml$ /index.php?sitemap=wpseo_local_kml last;
      rewrite ^/geo-sitemap.xml$ /index.php?sitemap=wpseo_local last;
      ## Video SEO
      rewrite ^/video-sitemap.xsl$ /index.php?xsl=video last;
    }

    Если у вас сервер, то вы так же можете перезапустить Nginx сервис — sudo service nginx restart и потом посмотреть изменения.

    Послесловие

    Если у вас до сих пор показывается ошибка, то вы можете написать под этой записью и я вам постараюсь помочь. А в целом, одно из решений выше вам точно должно помочь, так как других причин для появления 404 ошибки нет.

    Источник

    • Yoast официальная статья

    Об авторе

    Cправка — Search Console

    Войти

    Справка Google

    • Справочный центр
    • Сообщество
    • Search Console
    • Политика конфиденциальности
    • Условия предоставления услуг
    • Отправить отзыв

    Тема отзыва

    Информация в текущем разделе Справочного центра

    Общие впечатления о Справочном центре Google

    • Справочный центр
    • Сообщество

    Search Console

  • Yii2 ошибка сохранения модели
  • Yii2 отправка почты ошибка
  • Yii2 обработка ошибок валидации
  • Yii2 вывести сообщение об ошибке
  • Yesterday i get up very early текст содержит разные ошибки