title: Use .htaccess to force www AND https
body: <p>We have a WP Multisite install with a main site and one sub site.
  We just purchased UCC Certificate from Godaddy and wish to secure the entire site with https.</p>
  
  <p>We are looking to:
  redirect domain.com to www.domain.com
  redirect <a href="http://www.domain.com" rel="nofollow">http://www.domain.com</a> to <a href="https://www.domain.com" rel="nofollow">https://www.domain.com</a></p>
  
  <p>In other words, force www and https on everything..</p>
  
  <p>I have tried a few modifications to our .htaccess file without success.  Seems to cause problems with Google Chrome.</p>
  
  <p>Thanks in advance for any feedback or advice!</p>
  
  <p>S Cranston</p>
  
  <p>Here is my current .htaccess file:</p>
  
  <pre><code>## EXPIRES CACHING ##
  &lt;IfModule mod_expires.c&gt;
  # Enable expirations
  ExpiresActive On 
  # Default directive
  ExpiresDefault "access plus 1 month"
  # My favicon
  ExpiresByType image/x-icon "access plus 1 year"
  # Images
  ExpiresByType image/gif "access plus 1 month"
  ExpiresByType image/png "access plus 1 month"
  ExpiresByType image/jpg "access plus 1 month"
  ExpiresByType image/jpeg "access plus 1 month"
  # CSS
  ExpiresByType text/css "access 1 month"
  # Javascript
  ExpiresByType application/javascript "access plus 1 year"
  &lt;IfModule mod_headers.c&gt;
     SetEnvIf Origin "http(s)?://(www\.)?(www.simplymusicteachers.com/wp-admin/admin-ajax.php|www.simplymusicteachers.com)$" AccessControlAllowOrigin=$0$1
     Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>And here is the file with the additional code added in: </p>
  
  <pre><code>## EXPIRES CACHING ##
  &lt;IfModule mod_expires.c&gt;
  # Enable expirations
  ExpiresActive On 
  # Default directive
  ExpiresDefault "access plus 1 month"
  # My favicon
  ExpiresByType image/x-icon "access plus 1 year"
  # Images
  ExpiresByType image/gif "access plus 1 month"
  ExpiresByType image/png "access plus 1 month"
  ExpiresByType image/jpg "access plus 1 month"
  ExpiresByType image/jpeg "access plus 1 month"
  # CSS
  ExpiresByType text/css "access 1 month"
  # Javascript
  ExpiresByType application/javascript "access plus 1 year"
  &lt;IfModule mod_headers.c&gt;
     SetEnvIf Origin "http(s)?://(www\.)?(www.simplymusicteachers.com/wp-admin/admin-ajax.php|www.simplymusicteachers.com)$" AccessControlAllowOrigin=$0$1
     Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
  &lt;/IfModule&gt;
  Options +FollowSymLinks -MultiViews
  # Turn mod_rewrite on
  RewriteEngine On
  RewriteBase /
  
  ## force HTTPS and www. if any of them are not already present
  RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR]
  RewriteCond %{HTTPS} off
  RewriteRule ^ https://www.%1%{REQUEST_URI} [R=302,L]
  </code></pre>