title: Migrating Wordpress to HTTPS with redirect 301
body: <p>I just moved my wordpress site to HTTPS on the same server as before, and everything is working right. I set up a redirect 301 rule and got it working, however when checking the "flow" of traffic I noticed that from <code>http://www.domain</code> to <code>https://domain</code> I have at least two redirects instead of only one. This do not happen from <code>http://domain</code> or <code>https://www.domain</code> to the same <code>https://domain</code> page.</p>
  
  <p>The rule I'm using is:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  
  RewriteCond %{HTTPS} !=on
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  
  # BEGIN WordPress
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>I used <a href="https://varvy.com/tools/redirects/" rel="nofollow noreferrer">this link to test redirects count</a></p>
  
  <p>My fear is to lose speed and/or rankings of google. Any advice is appreciated.</p>