Redirect amp to non-amp

#621509
  • Hello. I used to have AMP pages (both /amp and /?amp). A few months ago I disabled the AMP plugin. I have your plugin’s redirection enabled. I set up a redirect from amp to non-amp using Regex Source URL: (.*)/amp with Destination URL: /$1 and Regex Source URL: (.*)/?amp with Destination URL: /$1. The problem I am having now is any URL on my website that has the letters “amp” (i.e. lamp) in it are returning 404s. What did I do wrong?

    By the way, I know your documentation says if amp URL ended in /?amp it wasn’t necessary to do a redirect but I want them gone from Google Search Console (because GSC shows so many of them)

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    Can you please share a screenshot of the redirection you’ve set for the /amp pages? You can use any image-sharing tool like https://imgur.com/upload to share the screenshot with us. Also, please share some affected /amp URLs with us so that we can check the issue further for you.

    However, the .htaccess rule you’ve shared will also work. If the issue persists, please head over to your WordPress dashboard > Settings > Permalinks, and hit the “Save Changes” button (without making any changes) to clear the permalink cache.

    Regarding, the /?amp URLs, as we already mentioned in our KB, the /?amp URLs have the correct canonical and as such, the query parameter will be ignored by Google so the AMP redirection shouldn’t be required in this particular case. If you set a redirection, then Google will start showing you the Page with a Redirect error.

    However, if you still want to redirect these URLs, then you can try the following rule in the .htaccess file of your site.

    RewriteCond %{QUERY_STRING}    "amp" [NC]
    RewriteRule (.*)  /$1? [R=301,L]
    

    You will have to add the rule before the WordPress rewrite rules.

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Redirect amp to non-amp’ is closed to new replies.