There is no documentation on how to avoid query string from being appended, although the existence of the
QSA option suggests that Apache might have a behaviour somewhat similar to
nginx — a trailing
? will ensure that no previous query string is appended.
BTW, if this doesn't work in Apache, I wholeheartedly invite you to try
nginx. Apart from having excellent performance, it also has excellent documentation and ease of configuration, and appending a
? simply makes the old string go away, and does not result in an empty question mark on the resulting redirect, either. So, it basically just works in nginx, and the whole behaviour if even officially documented, so you don't have to jump through any hoops.
If a replacement string includes the new request arguments, the
previous request arguments are appended after them. If this is
undesired, putting a question mark at the end of a replacement string
avoids having them appended