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

force www on forum

I want the forum to go to www.example.com if they go to example.com. This will make for a more consistent user experience and for better SEO.

Yet, I put this into my htaccess it didn't help.

RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

How do I make it work?


Well-known member
Try this:

order deny,allow

RewriteCond %{http_host} ^example.com [nc]
RewriteRule ^(.*)$ http://www.example.com/$1 [r=301,nc]