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 link for redirection
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 http://testwordpress.com it should get redirected to https://testwordpress.com
I followed most of the answers from this link, but nothing seemed to be working for me
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 443
RewriteRule ^(.*)$ https://testwordpress.com/$1 [R,L]
</IfModule>
# END WordPress
The below code gives me 503 error code
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTPS_HOST} !^testwordpress.com$ [NC]
RewriteRule ^(.*)$ https://testwordpress.com/$1 [L,R=301]