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

XF 1.4 Redirect Non-WWW to WWW with https

Discussion in 'XenForo Questions and Support' started by rbharathi, Mar 14, 2015.

  1. rbharathi

    rbharathi Member

    Hi I am hosting my forum at subdir,


    I am using SSL on my domain,

    Now i want to redirect non-www to www for my forum,
    so redirect should be http://example.com/forum to https://www.example.com/forum

    tried some settings posted on this forum, but i am getting error. Help please :)
    Thank you.

    Here is my part of code,

  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add these rules to the top of the .htaccess file in your /forum directory:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.yoursite\.com$
    RewriteRule ^(.*)$ https://www.yoursite.com/forum/$1 [R=301,L]
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.yoursite.com/forum/$1 [R=301,L]
    Jattitude and rbharathi like this.
  3. rbharathi

    rbharathi Member

    Thank you Jake :)
    It Works Perfectly :):cool::D

Share This Page