• Resolved toologic

    (@toologic)


    I use this plugin Yoast SEO on all my sites and have never encountered such a problem.
    There is a site with a large amount (~300,000) of content, and it was transferred to WordPress. When accessing the sitemap file, it turned out that it does not load. White screen and errors parsing the XML document. At first, I thought that the problem was related to the server load, but the admins said that the load was normal.

    Then I began to try to get a physical sitemap file, adding a filter to the code, by which I saved the value to the file. The file turned out to be correct and valid. The problem is that the browser could not access the xsl style file for display.
    I began to figure it out and simply copied your file wordpress-seo/css/main-sitemap.xsl to the root of the site.

    or, exclude it grom sitemap, using filter 'wpseo_stylesheet_url'

    And then it started:

    • a request to the /sitemap.xml redirects to the main page of the site
    • a request with a parameter /?sitemap=1 – shows the sitemap
    • a request to the /sitemap_index.xml – redirects to the main
    • a request to the /sitemap_index.xml/ with a final slash – shows the sitemap
    • following links from the sitemap index, like post_sitemap20.xml – redirects to the main page
    1. here are my redirection rules (at the top of the array)

    Array ( [sitemap_index\.xml$] => index.php?sitemap=1
    [([^/]+?)-sitemap([0-9]+)?\.xml$] => index.php?sitemap=$matches[1]&sitemap_n=$matches[2]
    [([a-z]+)?-?sitemap\.xsl$] => index.php?yoast-sitemap-xsl=$matches[1]
    ...
    [^wp-sitemap\.xml$] => index.php?sitemap=index
    [^wp-sitemap\.xsl$] => index.php?sitemap-stylesheet=sitemap
    [^wp-sitemap-index\.xsl$] => index.php?sitemap-stylesheet=index
    [^wp-sitemap-([a-z]+?)-([a-z\d_-]+?)-(\d+?)\.xml$] => index.php?sitemap=$matches[1]&sitemap-subtype=$matches[2]&paged=$matches[3]
    [^wp-sitemap-([a-z]+?)-(\d+?)\.xml$] => index.php?sitemap=$matches[1]&paged=$matches[2]

    Interestingly, all requests to wp_sitemap result in 404 error

    1. neither Apache nor Nginx have redirection rules for the sitemap mask – only a refusal to cache
    2. in the W3 Total Cache caching plugin, the sitemap file mask is included in the list of excluded caching
    3. I use a custom URL for the blog, but I use a filter 'wpseo_stylesheet_url' for the base URL issuing /

    I used the Health Check & Troubleshooting plugin – reset until all plugins were completely disabled – the problem persisted.

    Maybe you know of any solutions to this problem?

    • This topic was modified 2 months ago by toologic.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter toologic

    (@toologic)

    Additional info.
    The server reports that WordPress is the one “to blame” for the redirect

    x-redirect-by: WordPress

    Plugin Support Maybellyne

    (@maybellyne)

    Hello @toologic

    Thanks for reaching out regarding your sitemap.

    When accessing the sitemap file, it turned out that it does not load. White screen and errors parsing the XML document.

    When this happens, there’s usually a 500 <span style=”box-sizing: border-box; margin: 0px; padding: 0px;”>internal server error.?Can you check your server error log for the details of the error?</span>

    Furthermore, the sitemap index should load at the non-pretty permalink at /?sitemap=1 while sub sitemaps such as post or page will load at /?sitemap=post or /?sitemap=page respectively. Did yours load there?

    here are my redirection rules (at the top of the array)

    Depending on your server, you can find rewrite rules for NGINX or Apache servers. Also, when you use the Yoast SEO sitemap feature, /wp-sitemap.xml/ and /sitemap.xml/ 301 redirect to /sitemap_index.xml/, with x-redirect-by: Yoast SEO

    Thread Starter toologic

    (@toologic)

    Thanks for reply. Really, i found bad settings W3TC in nginx config file. Now it’s ok

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.