Category Archives: amp-html

How to redirect /amp URLs to the non AMP version?

Firstly, I would like to tell you guys that I have already searched the following threads for solutions, but they don't work.

.htaccess redirect /amp/ urls to nonamp version

How to redirect amp content to normal mode

Redirect from AMP URLs to Real URLs

I have added the rule: RewriteRule ^(.*)/amp$ $1 [R=301,L] in my .htaccess like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^(.*)/amp$ $1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

But it still doesn't take my amp links to their non-AMP original links. Please help me with this.

.htaccess rewriting URL to add a character to a URL

I'm doing this to fix an error with my AMP pages. I'm using the Automatic AMP plugin, and this plugin lets you access the AMP pages using 2 different methods

  1. site.com/post/amp/
  2. site.com/post/?amp

Using the AMP Page validator (https://validator.ampproject.org) I see that all AMP pages using just /amp/ get multiple errors, while /?amp is validated correctly.

Unfortunately, Google is checking /amp/ for all my pages, hence I'm getting tons of errors.

What I'd like to know is how to use the .htaccess redirect rule to add the ? to the AMP queries so all /amp/ requests are redirected (with a 301) to /?amp/

I'd appreciate suggestions on this. Thank you