system
December 10, 2015, 4:08am
1
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>
hillel
December 10, 2015, 4:37am
2
Another way to force SSL is to add REQUIRE_HTTPS=true
to the .env file in the root folder of the project.
system
December 10, 2015, 5:06am
3
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.”
hillel
December 10, 2015, 6:21am
4
Try changing line 37 in app/Http/Middleware/StartupCheck.php from
return Redirect::secure(Request::getRequestUri());
To
return Redirect::secure(Request::path());
system
December 10, 2015, 7:10am
5
Thanks so much for the suggestion it worked.
hillel
December 10, 2015, 7:12am
6
Thanks for letting us know, we’ll include this change with our next release.