1

Hi I just transfered a website from http development server to https production server.

As a result the page shows up but without files and assets and css. Browsers-Console says that it won't load inappropriate content from http sources. Why does contao do that, I thought all those assets and files are linked relative.

I did look for some settings that i might have to change but there is none.

Does anyone know anything about that. How can I switch properly to https ? kind regards martin

marschro
  • 791
  • 8
  • 23

1 Answers1

1

As @fritzmg knew it is a problem when you are behind proxies and contao cannot figure out if the request is http or https.

Adding this snippet to system/config/initconfig.php solves the problem

if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && 'https' === 
$_SERVER['HTTP_X_FORWARDED_PROTO']) 
{ 
    $_SERVER['HTTPS'] = 1; 
}  

More about in Contao: How can I change the protocol of the base url?

Community
  • 1
  • 1
marschro
  • 791
  • 8
  • 23