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
Try this methode:
# Redirect 301 all to https://www
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
RewriteRule (.*) https://www.example.com/$1 [L,R=301]
Why sometimes you don't need code %{HTTP_HOST} and use your domain exact url with www for the last line, because usually the result will have two www like:
https://www.www.yourdomain.com
Btw if you use cloudflare, just create pagerules redirect 301 all to https and www version.
Create pagerules Fill with
example.com/*
Choose setting forward url then choose 301 and fill with this
https://www.example.com/$1
Save it and all will be redirected to https and www version.