Reputation: 778
How would I write the.htaccess file to https://www.domain.com
example
domain.com => https://www.domain.com
www.domain.com => https://www.domain.com
https://domain.com => https://www.domain.com
http://www.domain.com => https://www.domain.com
Upvotes: 0
Views: 84
Reputation: 36
Try the following rule:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Upvotes: 2
Reputation: 3343
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]
This is the code i use. I checked it at http://htaccess.madewithlove.be/ as well :)
Upvotes: 0