XF 1.5 non-www to www.domain.com

It may not be related to XenForo, but thought someone can help here.

I want to redirect every URL in my forum :

domain.com to www.domain.com

How to do it ?

I can see some code from my earlier .htaccess file (used for vBulletin forum)

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [L,R]
Is this code correct (or) Am I missing something ?


XenForo moderator
Staff member
The rewrite code is the same across scripts - it's independent of the software.

Add it to the default XF .htaccess before the custom rewrite rules.