Hello all.
I tryed searching for an answer to my question, but seemess like the answers is a bit old/legacy.
My question and issue: I want to display the wwwDOTmydomainDOTcom instead of mydomain.com.
Im a beginner host, and been trying this for a few days now, and never would i imagine it being this hard.
I run openlitespeed and cyberpanel. I run a WordPress site with litespeed cache and QUIC.cloud cdn.
When I try to set the non-www → www template rule in my rewrite, the adresse bar changes indeed to www.mydomainDOTcom , but a warning is thrown saying i have too many redirections going on.
I tryed moving the line of code below is cache and above WordPress, and around, still same redirect error.
What I noticed, that seemes weird, is that if i remove the rule, my website works fine like this domainDOTcom . If i then remove the www cname that points to the root, it is being redirected to www.mydomainDOTcom , but the page is not found. This is without the rewrite rule.
Someone please help. Im about to go crazy
Edit*
Found a new rewrite rule:
# BEGIN Redirects
RewriteEngine On
# 301 redirect to www
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# 301 redirect to https
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# END Redirects
Still same. Browser redirects too many times.