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

Redirecting forum non-www to www

Discussion in 'XenForo Questions and Support' started by vexx, Mar 29, 2013.

  1. vexx

    vexx Active Member

    Hey guys,

    Just want to redirect the non-www version of the forum to the www one. Basically, site.com/forums/ to always redirect to www.site.com/forums/

    I tried adding this to the .htaccess but with no luck.

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

    RewriteCond %{HTTP_HOST} ^site.com/forums
    (.*) http://www.site.com/forums/$1 [R=301,L]
    Tnx in advance for any tips
  2. oldzy

    oldzy Active Member

    This is what I have in my Apache conf file...

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteCond %{HTTP_HOST} ^([a-z.]+)$ [NC]
    RewriteRule ^/(.*)$ http://www.%1/$1 [R,L]
    vexx likes this.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  4. vexx

    vexx Active Member

    worked great..tnx alot

Share This Page