Question
Redirect issue from HTTPS Non-WWW to WWW
I’m having issues with my domain pointing to my Wordpress Openlite Server. All except https://example.org is not pointing to my https://www.example.org site (all http points to the correct secure domain.
I know that this has been asked a lot and tried most of the suggestions including overwriting my .htaccess. I even used Redirect plugin but with no avail.
The latest code I used for the htcaccess is this:
RewriteEngine on
RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) https://www.example.com%{REQUEST_URI} [L,R=301]
It still wont redirect the correct one and this also causes issues on my other pages not redirecting the correct url. I also saw this:
RewriteCond %{HTTP_HOST} ^www\.your-domain\.com
RewriteRule (.*) https://your-domain.com/$1 [R=301,L]
But based on the rewrite Cond, it could only accommodate HTTP and not HTTPS.
Any help is much appreciated.
Thanks
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×