How to Fix 404 on AMP Pages After Deactivating the AMP Plugin

1
31

 

How to Fix 404 on AMP Pages After Deactivating the AMP Plugin

________________________________________________________________
>Do You Want To Receive Update As Soon As We Publish? join our Telegram Channel stay updated with the latest headlines--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.

  1. Go to Yoast SEO Plugin > Tools > File Editor
  2. In the .htaccess field add AMP to Non-AMP path redirection rule
  3. 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“.

redirection
  1. Install a free plugin called “Redirection
  2. Go to WordPress Dashboard > Tools > Redirection
  3. Add a new 301 Redirection
  4. Keep source /(.*)\/amp
  5. Target URL //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? 🤔

In the Apache server, .htaccess file is typically located in public_html directory. Or using Yoast File Editor or via WP File manager plugin can also be helpful.

Which method should I use .htaccess or Redirection?

If you’re using Apache web server then go with .htaccess else plugin way is easy.

My Search Console is still showing 404

Search Console may take some time to refresh data. Wait for few days and check again.

I hope this guides helps in fixing 404 for AMP URLs. If you have any specific query, please feel free to ask. Thanks!


Catego

 


**Join our Community and interact with fellow members>> Click here to join
------------------------------------------------------------------------
** Warning/Disclaimer: Ccnworldtech.com is not in any way affiliated to any Reviewed investment scheme or program. We only offer professional review service, strictly for informational and education purpose. And as such, users should conduct due diligence before participating in any of the reviewed investment programs! ---------------------------------------------------------------------------
JOIN US @TELEGRAM TO RECEIVE UPDATE CLICK HERE

** Grab My Ultimate List of Over 100+ Companies That Pays You Up To $2500 To Blog and Post Online ( #3000 Only))- CLICK HERE
>To Get all Recruitment and Aptitude test Past Questions and Answers Now--CLICK HERE ____________________________________________________________________
READ ALSO  How to Budget Money: 7 Baby Steps to Help You Budget Your Money

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here