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

Discussion in 'XenForo Questions and Support' started by Maton, Oct 10, 2014.

  1. Maton

    Maton New Member

    I am trying to make my website direct .domain.com to www.domain.com but nothing seems to work =/
    I've tried every possible combination of code in my htaccess file, and NOTHING works.

    what can i do? help would be appreciated..
  2. Brogan

    Brogan XenForo Moderator Staff Member

    To avoid posting possible solutions which don't work, what have you tried?
  3. Maton

    Maton New Member

  4. Solidus

    Solidus Well-Known Member

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    MattW likes this.
  5. Maton

    Maton New Member

    this is how my htaccess looks and it doesn't work:

    # Mod_security can interfere with uploading of content such as attachments. If you

    # cannot attach files, remove the "#" from the lines below.

    #<IfModule mod_security.c>

    # SecFilterEngine Off

    # SecFilterScanPOST Off


    ErrorDocument 401 default

    ErrorDocument 403 default

    ErrorDocument 404 default

    ErrorDocument 500 default

    <IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteCond %{HTTP_HOST} !^www\.kota.co.il

    RewriteRule ^(.*)$ http://www.kota.co.il%{HTTP_HOST}/$1 [R=301,L]

    # This line may be needed to enable WebDAV editing with PHP as a CGI.

    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    RewriteCond %{REQUEST_FILENAME} -f [OR]

    RewriteCond %{REQUEST_FILENAME} -l [OR]

    RewriteCond %{REQUEST_FILENAME} -d

    RewriteRule ^.*$ - [NC,L]

    RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]

    RewriteRule ^.*$ index.php [NC,L]

  6. Slavik

    Slavik XenForo Moderator Staff Member

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
  7. Maton

    Maton New Member

    changed the code to be like you pasted and still doesn't work.
  8. Slavik

    Slavik XenForo Moderator Staff Member

    Then you have a misconfiguration somewhere, I have used this on dozens of sites without issue.
  9. Maton

    Maton New Member

    any idea where the misconfiguration could be? or what should i do?
  10. Mike

    Mike XenForo Developer Staff Member

    Are you sure you're putting it in ".htaccess" and not "htaccess.txt"?
  11. Glockie

    Glockie Well-Known Member

    Silly question or two but;

    Have you listed in the admin CP that full domain as a URL with or without the www.

    If you have an ssl is it too, with or without www.?

    I had the exact same issue and then when checking everything I'd realised that I had omitted the www in some places yet included it in others, purely because of habit.

    Worth triple checking all of your settings if your .htaccess Is right.
  12. DragonFlames

    DragonFlames Active Member

    Can I ask a silly question please... which is it that you want.. your heading suggests that you want people entering domain.com to arrive at www.domain.com With all the hosting outfits I use that is just what happens.

    Your message though talks of wanting .domain.com to work and take you to www.domain.com - that doesn't work on my sites. I can set them up to work with anything.domain.com with no bother though. I don't get the wish to want just plain .domain.com to work... who would enter that.

    Ignore me if I'm missing the point.

    Glockie likes this.
  13. Maton

    Maton New Member

    I have listed the full domain, with WWW.

    so nobody can help me? I bought this script and untill now i still have 2 major problems.
    My logo appears as "not found picture" and the htaccess redirect is not working..

    with vBulletin and IPS it never happened to me..
  14. Glockie

    Glockie Well-Known Member

    Not found picture means there is a directory error or something, as for the rest I am more than convinced it's a server / backed issue or an issue with domain settings etc...

    I am by no means staff or anything like that, a customer - like yourself, but I will gladly take a look if you wish and need a hand? More than willing to lend a hand....
    Trust needs to be mutual, but it's nothing I've not done before... I daren't think of the amount of data and people's details I have seen over the years'
    Failing that, submit a ticket??
  15. Brogan

    Brogan XenForo Moderator Staff Member

    You claim you have tried every solution posted on this forum over the years and none of them work.
    In which case I would suggest contacting your host for support as it could be a server (mis)configuration issue.

    Regarding the logo, I have just checked your site and the file does not exist on the server in the location you have specified.
    Glockie likes this.

Share This Page