for the internal rewrite. This rule must not mention the domain name, and it will use only the [L] flag.
You also need a two line ruleset to redirect external URL requests using the URL version that includes parameters. You'll need a RewriteCond looking at THE_REQUEST as well as a RewriteCond looking at the path part of the URL request. The RewriteRule target should include the domain name and use the
[R=301,L]
flags.
This type of question comes up several times per week, so there are thousands of previous examples here.