Www to non-www not working

ForexTalk

Member
Hi,

I want to update the forum board from www to non-www. I was able to make redirect by editing .htaccess file, but seems like the board is only accessible via www version. The non-www version show 404 Not Found page.

I did change the basic options to reflect the change but it's still the same.

Any idea on this please?

Thank you.
 
I checked the 301config.php and it has:

$fileDir = 'C:/inetpub/wwwroot/xenforo';

Is that mean the forum is only available with www?
 
Did you tick enable board URL canonicalisation?
I did.

It's not issue with the redirect as I was able to do it. But the non-www board show 404 page, it's the error message from the webserver. I did restart the LiteSpeed server after the change too!
 
Yes, the code in .htaccess:

RewriteCond %{HTTP_HOST} www.example.com$
RewriteRule ^(.*)$ http://example.com$1 [R=301,L]

And the redirect did work!
 
The only one that does a correct redirect (for my websites) from www and from http to https without www is this with the RewriteEngine On:

Code:
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]

i tried all the variables, but for some reason it was redirecting not www but not https. With this above code I fixed my redirects

404 is also a typical redirect error.
 
Top Bottom