Help!! www vs non-www

#1
Hi all,
I can access my website page when typing "https://example.com/", but when typing "https://www.example.com/", I get a blank page.

I was told I need to redirect www to non-www http on a server that's running openlitespeed. My website is hosted on Vultr. How to do this?

Not sure if the below is relevant but I will include just in case. On the Vultr DNS pages, it shows the following:

TYPE ------------NAME------------DATA
CNAME------------*------------Example.com
MX------------------------------Example.com

Please help.
Thanks.
 
#2
UPDATE

I put the following in Virtual Host Rewrite tab:

Code:
RewriteCond %{HTTP_HOST} ^www\.example\.com
RewriteRule (.*) https://example.com/$1 [R=301,L]
now WordPress won't let me into my admin portal and it gives no error messages. When I click on forgot my password, I don't get any emails.
My under-construction page shows up. However, I can't get into my wp-admin's page!!

Please help. Thanks.
 

Cold-Egg

Administrator
#3
Do you have any existing redirect rules in the .htaccess file? What are your site URL settings? When you saw the blank page, any error code from the browser console, like 404?
 
#6
Hey, good to know that you have the issue fixed. Is it possible to share the solution?
This is what helped fix the issue.

Add the following rules to OpenLiteSpeed WebAdmin Console > Virtual Hosts > Rewrite > Rewrite Rules

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [R,L]

and in your wordpress, go to setting and make sure the link is like this:
Https://example.com
 
Top