• 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

Ablac

Active member
#1
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 :(
 

Tracy Perry

Well-known member
#3
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.
 

Ablac

Active member
#4
What is your .htaccess contents? If it causes a redirect loop you likely have conflicting rules in it.
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>
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.
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: