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

force www on forum

Discussion in 'XenForo Questions and Support' started by shovenose, Nov 3, 2013.

  1. shovenose

    shovenose Member

    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?
  2. AndyB

    AndyB Well-Known Member

    Try this:

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

Share This Page