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
Try the following rule:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
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 :)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.