Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: amp url serves cached canonical page #533

Merged
merged 1 commit into from
Apr 20, 2018
Merged

Conversation

rmpel
Copy link

@rmpel rmpel commented Mar 19, 2018

the AMP plugin creates urls with ?amp as GET parameters, but they don't get served in Expert mode caching with "don't serve cached page with get parameters".
This is because the RewriteCond says %{QUERY_STRING} !.*=.* which translates to "there must be an equals sign in the query string.
With ?amp there is no equals sign, so instead of an AMP page, the original page is shown.

This pull requests suggests a proper fix for this condition.

There is an alternative, namely testing for !.*=.* AND !amp but since the PHP version checks empty($_GET), there should not be anything in then Query string, hence ^$ for "blank".

@donnchawp donnchawp merged commit f497196 into Automattic:master Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants