Redirecting http to https with htaccess

Viewed 36

I have a webpage with the SSL certificate installed, that is http://homeopathy.50webs.com but I am unable to get it redirected to https://homeopathy.50webs.com

I tried by creating a ".htaccess" file in my root folder (that is, where all the other files are stored) with these contents to no avail:-

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

I tried this also to no avail:-

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://homeopathy.50webs.com%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

I tried this also to no avail:-

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://homeopathy.50webs.com/$1 [R,L]

Please let me know what I should put in the ".htaccess" file and if I need to do something more than the SSL certificate installation and ".htaccess" file redirection

0 Answers
Related