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

XF 1.4 HTTPS Redirect Loop

Discussion in 'Troubleshooting and Problems' started by Ablac, Jan 19, 2015.

  1. Ablac

    Ablac Active Member

    I've tried many things, from editing .htaccess file to making page rules in Cloudflare, but everything i do creates a Redirect Loop...

    Here's the issue:

    When a user visits http://earnyourrights.tk/forum its not encrypted

    but when they login it switches it to https.

    How do i make it always be encrypted, everything i add to the .htaccess file in regards to the https makes a redirect loop :(
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    What is your .htaccess contents? If it causes a redirect loop you likely have conflicting rules in it.
     
  3. Tracy Perry

    Tracy Perry Well-Known Member

    And have read the instructions on using SSL with CloudFlare. There are a few "gotchas" depending on which TYPE of SSL you are setting up on CF.
     
  4. Ablac

    Ablac Active Member

    My .htaccess is the default for Xenforo.
    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 405 default
    ErrorDocument 406 default
    ErrorDocument 500 default
    ErrorDocument 501 default
    ErrorDocument 503 default
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
        #    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 /xenforo
    
        #    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> 
    I have read them, but I will read them again encase i missed something.

    Edit: After Re-Reading Cloudflare SSL they say when using Flexable you need to use
    RewriteCond %{HTTP:CF-Visitor} !'"scheme":"http"'
    RewriteRule ^(.*)$ https://www.domain.com/$1 [L]

    When inputting those it creates a Redirect Loop...
     
    Last edited: Jan 20, 2015
  5. Ablac

    Ablac Active Member

    I think i got it to work... Not sure how... but I think its working now
     

Share This Page