title: wordpress http to https redirect not working
body: <p>I am trying to redirect my wordpress site from http to https. My wordpress site is on EC2 Instance and I followed this link for <a href="https://www.davidmeents.com/blog/add-ssl-ec2-wordpress-instance-use-https/" rel="nofollow noreferrer">link for redirection</a> </p>
  
  <p>I am able to see the https working, but however the default redirection from http to https is not happening. Like if I go to <a href="http://testwordpress.com" rel="nofollow noreferrer">http://testwordpress.com</a> it should get redirected to <a href="https://testwordpress.com" rel="nofollow noreferrer">https://testwordpress.com</a></p>
  
  <p>I followed most of the answers <a href="https://stackoverflow.com/questions/4083221/how-to-redirect-all-http-requests-to-https/21798882">from this link</a>, but nothing seemed to be working for me</p>
  
  <pre><code># BEGIN WordPress
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteCond %{SERVER_PORT} 443
  RewriteRule ^(.*)$ https://testwordpress.com/$1 [R,L]
  &lt;/IfModule&gt;
  
  # END WordPress
  </code></pre>
  
  <p>The below code gives me 503 error code</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteCond %{HTTPS_HOST} !^testwordpress.com$ [NC]
  RewriteRule ^(.*)$ https://testwordpress.com/$1 [L,R=301]
  </code></pre>