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

Automatically redirect /amp/ endpoint to ?amp on 404 responses #4466

Closed
westonruter opened this issue Mar 28, 2020 · 2 comments
Closed

Automatically redirect /amp/ endpoint to ?amp on 404 responses #4466

westonruter opened this issue Mar 28, 2020 · 2 comments
Labels

Comments

@westonruter
Copy link
Member

Feature description

When using another plugin that tries to use /amp/ for all URLs, switching to this AMP plugin can result in non-singular URLs 404ing. To deal with that, I created a helper migration plugin: https://gist.github.com/westonruter/6b7d3b168711ee03c4ee29b68c3719b2

Nevertheless, this seems like something that would make sense to be part of the the AMP plugin directly. In particular, it would make sense to add after #2204 is figured out.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

@westonruter
Copy link
Member Author

A related issue came up in #474 (comment).

Namely, if someone originally had /amp/ for pages, upon switching to the AMP plugin these URLs won't work anymore and they may end up getting routed to WordPress's own canonical redirect system, so in that case /some-page/amp/ will redirect to /some-page/ and not /some-page/?amp as expected. While we don't want to register an amp endpoint for pages, we should perhaps hook into WordPress's canonical redirects to check for /amp/ being present, and make sure that WordPress will redirect to ?amp (or ?amp=1 per #2204) instead of removing it from the URL altogether.

@westonruter
Copy link
Member Author

Closing as duplicate of #2062

@westonruter westonruter removed this from the v1.6 milestone Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant