Hi guys, I'm having a huge problem with my .htaccess.
If I try to change my htaccess into something like this:
<IfModule mod_rewrite.c>
RewriteEngine On
# Ensure the HTTPS protocol
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [L,NE,R=301]
</IfModule>
I get an ERR_TOO_MANY_REDIRECT error (I haven curl -I -L to check from my CMD the problem and it does actually ends up in a loop).
Is there a way to cleanly redirect http to https here?
If I leave the things the way they are, it seems like that google search engine prioritize the http version instead of the https version, and also a quick check on https://httpstatus.io shows that the website redirect the one without www but not the http into https creating two identical pages (one http://www and the other https://www), I hope this make sense.