Installing SLL destroyed the moodle page structure

Installing SLL destroyed the moodle page structure

by Gunilla Brattberg -
Number of replies: 4

I have two moodleinstallations in different subfolders at my web hotel. To get SSL they told med to write the following code in the .htaccess file in the mainfolder:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{HTTP_HOST}/$1 [R,L]

It did work fine for the Wordpress installations I have in other subfolders, but both my moodleinstallations lost the page structure.

What am I supposed to do to get SSL work together with Moodle?

/Gunilla



Average of ratings: -
In reply to Gunilla Brattberg

Re: Installing SLL destroyed the moodle page structure

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I always worry when Wordpress and Moodle get mentioned in the same sentence as they have somewhat incompatible hosting requirements.

Having said that, those settings above are the de-facto way to rewrite http to https and should work fine for Moodle. 

Can you explain what you mean by 'lost the page structure'?

Did you change the wwwroot setting in config.php to reflect the URL change? There's more info here - Transitioning_to_HTTPS

In reply to Howard Miller

Svar: Re: Installing SLL destroyed the moodle page structure

by Gunilla Brattberg -

Thanks for your answer,

After the SLL-code had been placed in the .htaccess-file I opened  both my moodleinstallations and they looked like they had lost the theme. I use the theme Serenity in one of them and Anomaly in the other. When I deleted the SLL-code everything looked fine again.

I didn´t do any change in config-php.

Yesterday, I had a dialogue with my webhotel and they have told me that this code is all that I have to include in the .htaccess file in the main folder to get SSL to work in all subfolders where I have my Moodle-installations. I will contact them on monday again, but I am sure they have very little knowledge about Moodle.


In reply to Gunilla Brattberg

Re: Svar: Re: Installing SLL destroyed the moodle page structure

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You *definitely* need to change the config.php file (please read the link in my post above). 

It's probably a good idea to purge your caches too (see Developer_tools). 

Your problem is that assets such as css files can no longer be reached due to the (now) incorrect config.php setting.

In reply to Howard Miller

Svar: Re: Svar: Re: Installing SLL destroyed the moodle page structure

by Gunilla Brattberg -

Thank you!

Now it seems to work - since I have changed http to https in the config.php files to the two moodle installations.

Mysterious enough I didn´t have to do any changes in wp-config.php files in the Wordpressinstallations.

/Gunilla