How to Fix 404 on AMP Pages After Deactivating the AMP Plugin
⇒Join us on Telegram for more Sure and Accurate football-winning tips every day...click here
Do you want to redirect AMP permalink to the Non-AMP URL? This guide is going to help you.
You might know well, Twitter has also started serving AMP pages. Therefore, using redirection is very important to prevent from 404 hits for old AMP WordPress permalink. After deactivating the plugin, you will receive Error 404 for all AMP permalinks.
To fix this problem, you need to setup a redirect from the AMP to NON-AMP(canonical) URL.
- Go to Yoast SEO Plugin > Tools > File Editor
- In the .htaccess field add AMP to Non-AMP path redirection rule
- and Save changes
# Redirect from AMP to non-AMP path RewriteEngine On RewriteCond %{REQUEST_URI} (.+)/amp(.*)$ RewriteCond %{REQUEST_URI} !^/wp-content/(.*)$ RewriteRule ^ %1/ [R=301,L]
Important changelog IST 3:15 PM 5/11/2020
* Excluded wp-content, concerning images which may contains ‘amp’ in the name.
What if you don’t have control to .htaccess?
Alternatively, you can also prevent 404 by doing a redirect from AMP to non-AMP path (canonical) pages using a free plugin called “Redirection“.
- Install a free plugin called “Redirection“
- Go to WordPress Dashboard > Tools > Redirection
- Add a new 301 Redirection
- Keep source
/(.*)\/amp
- Target URL
https://www.yourdomain.com/$1
Kindly note: These steps should be implemented after disabling/noindexing AMP properly.
How do I set AMP to Canonical Redirect in case of NGINX?
location ~ /amp/?$ { rewrite ^(.*/)amp/?$ $1 permanent; }
Where I can find .htaccess file? ?
Which method should I use .htaccess or Redirection?
My Search Console is still showing 404
I hope this guides helps in fixing 404 for AMP URLs. If you have any specific query, please feel free to ask. Thanks!