title: htaccess - IP canonicalization to HTTPS
body: <p>Bitnami wordpress on Google Cloud. </p>
  
  <p>Ok, the below code, diverts all to https non-www which works great, but the issue is we can't get the dedicated IP to redirect to https url. Please see below;</p>
  
  <pre><code>RewriteEngine on
  
  
  &lt;ifModule mod_rewrite.c&gt;
  RewriteBase /
  
  # IP REDIRECT CONANIZATION
  RewriteCond %{HTTP_HOST} ^00\.00\.93\.114$
  RewriteRule ^(.*)$ https://example.co.uk/$1 [L,R=301]
  
  
  ### WORKING HTTP to HTTPS / NON-WWW - WORKS
  
  #if not example.co.uk then redirect to example.co.uk
  RewriteCond %{HTTP_HOST} !^example\.co.uk$ [NC]
  RewriteRule .* http://example.co.uk%{REQUEST_URI} [L,R=301]
  
  #if not https
  RewriteCond %{HTTPS} off
  #redirect to https
  RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  
  &lt;/IfModule&gt;
  </code></pre>