-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Wrong path for AMP pages #183
Comments
Both We already do assume a permalink structure without arguments when we use In terms of "which of my posts is accessed how often" the explicit AMP parameter is not optimal anyway and subject to be changed in the context of #104 (mark mobile usage) where AMP calls could be marked differently. |
Apparently we do some cleanup that removes a trailing statify/inc/class-statify-frontend.php Lines 94 to 100 in 23f9e36
Original: After "generation of relative target URL" including Then, if permalink structure is used, we trim arguments: So the information is lost while trailing We would have to parse the query here, However On my test site (Official plugin 2.0, Standard mode, no special config) all three calls redirect to the actual page served through AMP. Apparently that's not always correct as your site shows a 404 instead. |
Is this AMP issue fixed with #182 released with Statify 1.8.1 today? |
No, it’s not. The issue is still open. |
The reference commit fa211b4 should solve the issue. Another solution might be dropping the AMP suffix completely. The displayed content is more or less the same and we do not interpret mobile/desktop views either, no matter if they differ, so why should we treat AMP in a special way? (or if, why not considering all, see #104) Imo the decision is not really what is “correct“, but more what we want to express here and how. |
At least the variant with It results in a 404. But yes, if you don’t want to have any difference (with what I could easily live with), omitting these value from the URL entirely would be an easy option. As long as it’s still counted as page view. 😄 |
@stklcode Your commit fa211b4 may produce a notice:
It seems you also need to check for |
I think that's what I actually wanted to check in this line 🙈 |
Currently, for AMP pages the URL gets extended by an
amp/
(https://github.com/pluginkollektiv/statify/blob/develop/inc/class-statify-frontend.php#L428). However, this will result in wrong URLs since https://example.com/ will become https://example.com/amp/ in the database. The correct way would be to add an?amp
or&
to the URL to get a valid URL, which is the AMP variant of the page.The text was updated successfully, but these errors were encountered: