I want to redirect from any direction to our site with HTTPS protocol, but some redirects it's not working. I want this:

  • http://www.site.co TO https://www.site.co
  • http://site.co TO https://www.site.co

This is my htaccess:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301] 

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301]

The second rule it's not working. It going to another direction inside our site, and it isn't redirect to HTTPS site.

Edit
Report