Cloudflare Pro + LiteSpeed Cache: Mobile Users Not Redirected to AMP

What is the name of the domain?

What is the issue you’re encountering

Mobile Users Not Redirected to AMP

What steps have you taken to resolve the issue?

Hi Community,

We’re currently facing an issue where mobile users are not being redirected to the AMP version of our WordPress website after enabling Cloudflare Pro and APO (Automatic Platform Optimization).

Here’s our setup:

WordPress website

AMP plugin (official AMP by WordPress)

LiteSpeed Cache plugin

We’ve already disabled the following features in LiteSpeed Cache for compatibility with Cloudflare APO:

Guest Mode

WebP Replacement

Mobile Cache

JS/CSS Minify

JS/CSS Combine

Despite this, mobile visitors continue to see the non-AMP version. AMP URLs are accessible if manually visited, but auto-redirection isn’t happening as expected.

We’re using Transitional mode in the AMP plugin, which is supposed to redirect mobile users automatically.

What we’ve tried so far:

Purged all caches (LiteSpeed, Cloudflare)

Disabled conflicting features

Verified AMP plugin settings

Tested on multiple devices and browsers

Checked server response headers — nothing blocking AMP

Turned off APO to test, and AMP redirection starts working again

It seems like Cloudflare APO is aggressively caching and serving the desktop version, ignoring the user agent/mobile redirect logic.

Has anyone else faced a similar issue with Cloudflare APO or Cloudflare Pro and AMP?

Looking for suggestions or a possible fix/workaround.

What settings have you got enabled on the plugin admin page? :thinking:

Is AMP Real URL feature enabled at Cloudflare dashboard for your domain?

Are you also using SXG feature or not (should not enable it).

I can see you’re using /?amp=1.
I’d suggest /amp/ instead.

I tested and can see the AMP URL example is valid:

Furthermore, mobile users should only be redirected or open it if the URLs are indexed and crawled by Google Search engine and only if the users clicks from the Google News or Google Discover on their mobile phone.

Nevertheless, your Website isn’t “AMP only”, therefrom anyone coming from e.g. Google Chrome or openning your URls direclty, would land on the “non-AMP” version by default (responsive web design).

I haven’t tested this, since I am using “Reader” and “Legacy” as I’ve made my own AMP style-theme.

  • In Transitional mode your site will have a non-AMP and an AMP version, and both will use the same theme. If automatic mobile redirection is enabled, the AMP version of the content will be served on mobile devices. If AMP-to-AMP linking is enabled, once users are on an AMP page, they will continue navigating your AMP content.

I am not sure how does the “automatic mobile redirection” work, if you’ve got it enabled. Is it JavaScript or PHP based? :thinking:
Could you dug and see with the developer of the plugin for more information?

Could be true, yes.

Wonder if you could give it a try as follows here:

But, would require to setup APO on sub-domain as well and rewriting URLs to e.g. mobile.example.com if so :thinking:

This topic was automatically closed after 15 days. New replies are no longer allowed.