This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

octobro
octobro

Hi there,

I am currently using Cloudflares 'flexible' SSL. Whilst it switches the current site to https, I am getting issues with 'mixed content'. Turns out some links are still http whilst the admin area is completely broken due to not loading the css/js scripts.

Is there a simple way to fix this? I have tried to force https by adding this to my .htaccess

RewriteEngine On
# Force https 
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

When I do this, I get a redirect loop and cannot access the website.

Also I have tried to edit app.php and add in https://, nothing changes. When I add in

App::before(function ($request) {
 if (!Request::secure() && app()->env == 'production')
 {
     return Redirect::secure(Request::path());
 }
});

to app/filters.php, I get a redirect loop. My Apache virtual host is set to :80 for the particular website, do I need to add in a :443 config?

I have also tried adding to filters and nothing changes.

  if( ! Request::secure() && getenv('CMS_ENV') == 'production')
{
    return Redirect::secure(Request::path());
}

Is there any way I can fix this?

Last updated

benparsell15255
Eoler
Eoler

benparsell15255 said: Is there a simple way to fix this?

Try this (feel free to read the whole back and forth including linked issues): https://github.com/octobercms/october/issues/856#issuecomment-223208136

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.