AMP redirect to non-amp

LondoN eXtream

Regular Member
Joined
May 14, 2020
Messages
294
Reaction score
194
Hi.

I was struggling with this for a lot. Basically, i am looking forward to a method / ideea on how can i redirect all AMP traffic /slug/amp to /slug, without Google deindexing the /amp/ version from the website.

Basically, redirect all real users but not the google bot, so the pages keep indexing and ranking.

I've tried fetching the google bot via htaccess/php but in the end i am getting errors in Search Console for 'Page with Redirect' and they start deindexing the amp results.

I am curious if someone managed this and can give me a clue on it.
 
Could you test the below plugin:
https://codefile.io/f/Khm7QKyA8V

Just make a new PHP file in the '/wp-content/plugins/' folder,
You can name it anything, for example, 'amp-cloacking.php', copy & paste the code there,
Then activate the plugin from the WP Dashboard > Plugins,

Test and let me know if it works :)
 
Thanks for your reply hideath.

This was the first approach i used, detecting the google bots and displaying them the page, and redirecting the remaining users. But as i said, somehow google deindex the pages. So no, that method does not work. I've tried the same method using htaccess.

I am looking for something else.

Maybe the bot is accesing the amp pages for crawl it's not related to a 'GoogleBot' string.
 
Back
Top