I'm trying to create a 301-rewrite for URLs ending with ?amp=1
to nearly the same URL and query string, just stripping the value (=1
).
Examples:
https://example.com/?amp=1
should redirect tohttps://example.com/?amp
https://example.com/page/?amp=1
should redirect tohttps://example.com/page/?amp
I've managed to get the RewriteCond
right to match only URLs ending with ?amp=1
, i.e.:
RewriteCond %{QUERY_STRING} ^/?amp=1$
but can't get the RewriteRule
correct to go to the URL without the =1
value.
RewriteRule
in your question, even if it fails.?amp=1&foo=qux&bar=quux
)?.htaccess
)?