Since integrating SSL (HTTPS) across all my OctoberCMS sites, I have noticed that the backend is linking all the way back to the http:// url with absolutely everything instead of just starting the links at /modules/backend/ or /system/backend. (This is for importing CSS, JS, general links, etc.)
The problem with this is that no CSS or JS loads when visiting the backend when on an SSL connection (which I now have forced across my site using CloudFlare) because it is forcing http links over an https connection. I had this same problem on some of my Laravel based projects and all I had to do to fix it was inside of app --> filters.php I just had to put in:
App::before( function( $request ){
// set the current IP (REMOTE_ADDR) as a trusted proxy
Request::setTrustedProxies( [ $request->getClientIp() ] );
});
Now this doesn't seem to work with OctoberCMS and I can't for the life of me find a way to force https:// over http:// for all of the CSS & JS files that are imported into the project on the backend.
Would really appreciate any ideas/suggestions as I have been searching around and trying to fix this problem for days now.
I mean really, they are all local files, why does the framework even have the entire site URL anyway? Instead of having http://site.com/modules, why not just have it do /modules by default and then you won't have any of those pesky SSL problems with local files..
Thanks!
Last updated