Support » Plugin: Glue for Yoast SEO & AMP » AMP 404 error

  • Hi there,

    Currently the AMP URL in the header is as follows:

    <link rel="amphtml" href="http://mydomain.xyz/about-us/amp/" /><script> – I changed the domain name.

    But when accessing any “page” with /amp/ it gives a 404.

    The AMP on “pages” only works by adding ?amp=1 to the URL. The problem is that the link in the header is pointing to /amp/ and so the Google bot accessing pages generates 404 errors.

    How can I rewrite the link URL to use ?amp=1 instead of /amp/ so that the AMP on pages can work?

    I’ve got this installed on a couple of websites and all are using the /amp/ in the URL and none seem work.

    Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • Anyone else experience this problem?

    How can I rewrite the the link URL in the header to use ?amp=1 instead of /amp/?

    Anton – I have the exact some issue (on several sites). For POSTS it works fine with /amp/ but for Pages (with that option enabled) /amp/ 404’s. Like you I can also get to the AMP page by specifying ?amp=1.

    IMO this is a bug (I’ve tested it on several WP installs including a fresh one). If you happen to come across a solution before Yoast responds please post it here. Thanks.

    I got the same errors, turned off Pages and no errors. But, my pages are not AMP. Why is this happening? Why, if this is a new standard that has advantages, is it so difficult to get working and why would anyone, if the required ending is /amp/ have it generate ?amp=1?

    If anyone comes up with a fix, please share! If I can figure it out, I will let you all know how.

    It’s the same for me ….

    I found a short term solution.

    In the plugin /amp/includes/amp-frontend-actions.php

    Change

    $amp_url = amp_get_permalink( get_queried_object_id() );

    To

    $amp_url = get_permalink() . "?amp=1";

    This changes the current URL from /amp/ to /?amp=1

    Problem is that it’s actually not Yoast related and someone might have a better solution or fix, because when the AMP plugin gets updated, the changes will be lost.

    They just updated the AMP plugin. Now it doesn’t 404, it redirects to the non-AMP page. It seems as though this is an issue with the Automattic AMP plugin, not Yoast’s plugin… Yoast’s plugin now says:

    Please note: Currently pages are not supported by the AMP plugin. We still show this option to be able to provide functionality when the AMP plugin implements support for them.

    …right above the “Save Changes” button. Which let me to the Automattic AMP Plugin which says:

    Note #1: that Pages and archives are not currently supported. Pages support is being worked on.

    Hope they update the Automattic plugin soon…

    I’m having this issues on a blog with 0.4.2 AMP plugin also. I have no idea what is going on, used to work like a charm. Now the <link rel=”amphtml” link goes to a 404 page.

    • This reply was modified 2 years, 3 months ago by  DrLightman.

    I somehow fixed the problem by hitting Save on the Settings>Permalink dashboard page, without doing any new modification, only an hit of Save.

    Thanks DrLightman,
    Your solution working awesome.

    • This reply was modified 2 years, 2 months ago by  Gujar Singh.

    Thanks DrLightman. How did you get this idea?^^ WTF.

    Anton Koekemoer: Did you install ‘AMP for WP Accelerated Mobile Pages’ plugin first? if not install it and install the AMP plugin, so you will have to install 2 plugins:’AMP for WP – Accelerated Mobile Pages’ plugin and ‘AMP’ plugin. after it will work perfectly.
    Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘AMP 404 error’ is closed to new replies.