I would like to create a mod_rewrite rule that redirects this:
www.domain.com/original/
To this with an appended anchor:
www.domain.com/new/#something-else
It should also preserve any query string specified in the original URL, when present. For example:
www.domain.com/original/?key=example
Should redirect to:
www.domain.com/new/?key=example#something-else
I tried using the following mod_rewrite rule with the NE and QSA flags, and even though it preserves the anchor and query string, they are rewritten in the wrong order: query string after anchor instead of before.
RewriteRule ^original https://%{HTTP_HOST}/new/$1#something-else [QSA,NE,R=301,L]
How can I preserve the original query string (when present) and append the anchor to the end?
Thanks