Home Forums Support SSL Redirect Loop

This topic contains 5 replies, has 2 voices, and was last updated by  Hillel Coren 3 years, 4 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1774

    Anonymous

    When editing the .htaccess file to force https access I’m getting a redirect loop.

    # Enable this to enforce https access
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L]

    Here is the complete .htaccess file

    <IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
    Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes…
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller…
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Enable this to enforce https access
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L]
    </IfModule>

    #1775

    Hillel Coren
    Keymaster

    Another way to force SSL is to add REQUIRE_HTTPS=true to the .env file in the root folder of the project.

    #1776

    Anonymous

    Thanks for your assistance,

    I added that option in the .env file

    But now when accessing the site it sends me to /public/public instead of the correct /public/dashboard
    with the message “Sorry, the page you are looking for could not be found.”

    #1777

    Hillel Coren
    Keymaster

    Try changing line 37 in app/Http/Middleware/StartupCheck.php from

    return Redirect::secure(Request::getRequestUri());

    To

    return Redirect::secure(Request::path());

    #1778

    Anonymous

    Thanks so much for the suggestion it worked.

    #1779

    Hillel Coren
    Keymaster

    Thanks for letting us know, we’ll include this change with our next release.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Posted in: