Forums

Join
bbPress Support ForumsTroubleshootingRedirecting non-www to www version

Info

Redirecting non-www to www version

  1. My site is both www and non-www. If I'm logged in the www version and I visit the non-www version, it shows that I'm not logged in.

    I just want to keep only the www version, I know this can be done via redirect, but how exactly for bbpress does this work.

    Thanks.

  2. Add

    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/ [L,R=301]

    to your .htaccess (right under RewriteEngine On)

  3. Thanks.

    I tried that code.

    The result:
    http://domain.com now goes nicely to http://www.domain.com

    If I encounter problems, I'll let it be known.

  4. You must log in to post.