How to Redirect /?amp to Normal Url

I disabled AMP of Newspaper theme official AMP plugin.
And I have used redirection from /(.*)/amp to https://www.mysite.com/$1

Everything works fine and AMP pages are now directing to Non AMP but the /?amp in the url is still exists for Non AMP pages.

How to redirect /?amp to Normal url?

Hi Nadh,

To redirect Query String Parameter amp to normal slug, add below line at top of .htaccess

# Bye-Bye AMP
<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteCond %{QUERY_STRING}    "amp" [NC]
	RewriteRule (.*)  /$1? [R=301,L]
</IfModule>

Can u please tell me how to do the same via Redirections plugin using Regex

I mean what will be the Source URL and Target URL

By the way, I used Official AMP which returns /?amp in the end or URL

I tried as per documentation. It doesn’t work for me.

Here’s an alternative way …

1 Like

Unfortunately, Regular Expressions are not working for me…

Can I apply the RewriteEngine code on Nginx, DigitalOcean droplet?

This is the screenshot of page rule in Cloudflare
aa

Its working fine for/?amp= from Cloudflare, thanks

1 Like

Consider removing equal sign then it will work perfectly

1 Like

Yes It’s perfect now…

I have one doubt… In future If I see any AMP errors in Search Console, How to deal with them…
Can I ignore them?

There wont be any error if you followed steps to noindex AMP pages first in SERPs then setting up redirect.

1 Like