I have a similar situation as described in
the difference is I don't use custom post permalink /%postname%.html
but just /%postname%
, so my post URL looks like this https://www.example.com/post
.
And problematic URLs added by amp plugin are sitewide (not just post URL).
Post URL
https://www,example,com/post?amp
https://www,example,com/post?amp=0
https://www,example,com/post?amp=1
https://www,example,com/post?noamp
https://www,example,com/post?noamp=mobile
https://www,example,com/post?noamp=1
https://www,example,com/post/amp/
https://www,example,com/post/amp
Category URL
https://www,example,com/category/123?amp
https://www,example,com/category/123?amp=0
https://www,example,com/category/123?amp=1
https://www,example,com/category/123?noamp
https://www,example,com/category/123?noamp=mobile
https://www,example,com/category/123?noamp=1
https://www,example,com/category/123/amp/
https://www,example,com/category/123/amp
Tag Archieve
https://www,example,com/tag/123?amp
https://www,example,com/tag/123?amp=0
https://www,example,com/tag/123?amp=1
https://www,example,com/tag/123?noamp
https://www,example,com/tag/123?noamp=mobile
https://www,example,com/tag/123?noamp=1
https://www,example,com/tag/123/amp/
https://www,example,com/tag/123/amp
Paginated and search result variation example
https://www,example,com/tag/123/page/1?amp
https://www,example,com/category/123/page/1?amp
https://www,example,com/page/1?noamp=mobile
https://www,example,com/?q=search_term&
My .htaccess
:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Can .htaccess
catch all those URL parameters and redirect them to the corresponding permalink?