• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 Mod_rewrite help for VB to Xenforo URLs


I've redirected my VB links to Xenforo but it redirects to the HTTP version, not the HTTPS.
I'd like to redirect all URLs to HTTPS with a minimum number of hops as this is eventually an SEO issue.
Here is what I currently have:
RewriteRule [^/]+/.+-t([\d]+).html showthread.php?t=$1 [NC,L]
RewriteRule ^[^/]+/thread-t([0-9]+)-([0-9]+)\.html$ /forum/threads/$1/page-$2 [R=301,L]
RewriteRule ^[^/]+/[^/\.]+-t([0-9]+)-([0-9]+)\.html$ /forum/threads/$1/page-$2 [R=301,L]
RewriteRule ^members/([^\.]+)\.html$ /forum/member_redirect.php?username=$1 [R=301,L]
RewriteRule ^attachments/(.+)/([0-9]+)[d-](.+)$ attachment.php?attachmentid=$2 [L]

So what it does is that it takes the VBSEO URLs and uses 3 times 301 to get to the Xenforo URLs but the HTTP ones, not the HTTPS.

If I add the following I get 5 total 301 redirects, more than Google likes to see and slowing down requests too:

RewriteCond %{HTTPS} !on
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

How can I redirect my VBSEO URLs to HTTPS with the minimum possible number of 301 redirects?