i'd like to remove question mark and value at the end of a url ending with amp.

For example, i want the following url:


to be like this:


What is the right way to do it using htaccess? Thank you.

1 Answer 1

RewriteEngine On
RewriteCond %{QUERY_STRING}  .
RewriteRule (.*) /$1? [R=301,L]

You could test it e.g. here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.