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

XF 1.4 You Must Be Logged In

Discussion in 'Troubleshooting and Problems' started by Grizzly Adam, Oct 31, 2014.

  1. Grizzly Adam

    Grizzly Adam Active Member

    Some users are complaining that if they do not check the "stay logged in" button when they access the notification or conversation pulldowns it tells them that they need to be logged in. We recently relocated to a new server, that may be related.

    34832-f2a32057acfa37fcd2170275c7d2816b.jpg
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Your site is available via the www and non-www URL.

    You need to force it to one or the other.
     
  3. Grizzly Adam

    Grizzly Adam Active Member

  4. Brogan

    Brogan XenForo Moderator Staff Member

  5. Grizzly Adam

    Grizzly Adam Active Member

  6. Martok

    Martok Well-Known Member

  7. Grizzly Adam

    Grizzly Adam Active Member

    Try it on my site. It's not working.
     
  8. Martok

    Martok Well-Known Member

    Try these instead:

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

    Code:
    RewriteCond %{HTTP_HOST} !^example\.com
    RewriteRule (.*) http://example.com/$1 [R=301,L]
     
  9. Grizzly Adam

    Grizzly Adam Active Member

    Both behave the same as the other one. Still have two sites.
     
  10. Martok

    Martok Well-Known Member

    I notice that you have your forum in a subfolder called /forums. Just checking that you do have your .htaccess file in the root directory and not the forums directory?
     
  11. Grizzly Adam

    Grizzly Adam Active Member

    .htaccess is in the root.
     
  12. Tracy Perry

    Tracy Perry Well-Known Member

    If you have it in a subdirectory off root, then your .htaccess needs to be in that one.
     
  13. Grizzly Adam

    Grizzly Adam Active Member

    Thanks. If I put www in front of any address it takes me to the home page. Is this how they are supposed to work?
     
  14. Tracy Perry

    Tracy Perry Well-Known Member

    Depends on how it's set up... you can either set it up so that all requests go to the www site or that all requests are stripped of any www prefix and goes to the site (which is what I do on all my forums).
     
  15. Grizzly Adam

    Grizzly Adam Active Member

    That's what I would like to do. Please advise.
     
  16. Tracy Perry

    Tracy Perry Well-Known Member

    Looks like you have it working.. just hit the site with a www. prefix and it stripped it.
    That rewrite needs to be the first rewrite in your .htaccess that you are using.
     
  17. Grizzly Adam

    Grizzly Adam Active Member

  18. Tracy Perry

    Tracy Perry Well-Known Member

    The latter is a working link... when I try to click on your first one it gives a link that looks like
    firewoodhoardersclub.com%24/#post-181343 (notice the %24 in the link).

    I don't exactly understand what the problem is. The second should be correct as a link (as the www is stripped). You have another problem in your rewrite somewhere that is inserting that %24 part of a link.

    Post your full .htaccess you have in your /forum directory here.
     
  19. Grizzly Adam

    Grizzly Adam Active Member

    It is now just dropping only the /forums portion of the url. http://firewoodhoardersclub.com/forums/threads/whats-your-temp-what-ya-burnin-14-15.6742/

    Code:
    #    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
    #</IfModule>
    
    ErrorDocument 401 default
    ErrorDocument 403 default
    ErrorDocument 404 default
    ErrorDocument 500 default
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
    RewriteCond %{HTTP_HOST} www.firewoodhoardersclub.com$
    RewriteRule ^(.*)$ http://firewoodhoardersclub.com/$1 [R=301,L]
    
        #    If you are having problems with the rewrite rules, remove the "#" from the
        #    line that begins "RewriteBase" below. You will also have to change the path
        #    of the rewrite to reflect the path to your XenForo installation.
        #RewriteBase /forums
    
        #    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]
    </IfModule>
     
  20. Mike

    Mike XenForo Developer Staff Member

    I don't see any redirection, but if you're inside the forums directory, your redirect may need to be:
    Code:
    RewriteRule ^(.*)$ http://firewoodhoardersclub.com/forums/$1 [R=301,L]
     

Share This Page