How To Reddirect All Calls To Http To Https Using .htaccess

How to redirect from non-secure http to secure (SSL) https

Create a .htaccess file in your wwwroot folder (Windows hosting) or your public_html folder (Linux hosting), containing the following, replacing mydomain.com with your domain name:

 

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

Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 8278

Need more information or have a question ?