So I'm using the answer from here to remove the query string: How to remove GET parameters from url with htaccess? And it works fine in general.
Here are the rules I'm using (in the beginning of the htaccess):
RewriteEngine on
RewriteCond %{THE_REQUEST} \?
RewriteCond %{QUERY_STRING} !^p=
RewriteRule (.*) https://www.r-bloggers.com%{REQUEST_URI}? [R=301,L]
BUT...
If I browse using a mobile device to this url:
t.co/6raI2VkTse?amp=1
It will redirect me to this url (and will stay there, without a further redirect, even though it has a url parameter):
If I then refresh, it will redirect me to: https://www.r-bloggers.com/how-to-handle-cran-checks-with-help-from-r-hub/
I've tried adding:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^(.*)&?__twitter_impression=[^&]+&?(.*)$ [NC]
RewriteRule ^/?(.*)$ /$1?%1%2 [R=301,L]
(from here) But this also didn't help.
I have no idea why this is happening. Any suggestions?!