I've managed to do a wildcard 301 redirect successfully, but I'd like to know if it is necessary to keep the rewrite rule forcing HTTPS and if the order of the code in the .htaccess file matters.
For example, I should do a redirect chain like http://oldsite.com to https://oldsite.com to https://newsite.com
This is the .htacess file on the old site:
# HTTPS forced by SG-Optimizer
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
# END HTTPS
#REDIRECT
Redirect 301 / https://newsite.com/
#END REDIRECT