Quantcast
Channel: Topic Tag: xml | WordPress.org
Viewing all articles
Browse latest Browse all 3201

Native Sitemaps Broken with Litespeed

$
0
0

I have been using LiteSpeed for site performance since forever, and couldn’t love it more.

To improve performance, I removed sitemap plugin, and built my native code that writes XML files like sitemap2024.xml, sitemap2023.xml (https://milyin.com/sitemap2024.xml)

Google Search Console says it cannot read my sitemaps.

Initially I thought it was an issue at my end. But here’s the weird part.

If I submit https://milyin.com/sitemap2024.xml it doesn’t work, but, if I submit https://milyin.com/sitemap2024.xml?refresh=1 it submits easily.

since refresh is a part of “Do Not Cache Query Strings”

So, that works. I suspect LiteSpeed to be messing around with it.

function my_custom_sitemap() {

    if (strpos($_SERVER[‘REQUEST_URI’], ‘/sitemap’) !== false) {

        //header(‘Content-Type: application/xml; charset=UTF-8’);

        define( ‘LITESPEED_DISABLE_ALL’, true );

    }

}

add_action(‘template_redirect’, ‘my_custom_sitemap’);

This didn’t work.


Viewing all articles
Browse latest Browse all 3201

Trending Articles