• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 non-www to www.domain.com

#1
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)

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

Brogan

XenForo moderator
Staff member
#2
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.