Moodle site config and HTTPS

Moodle config.php

The Moodle config.php file stores important settings such as the url of this site. When setting the site url to use https for secure connections, or when the domain has changed (during a site migration, for example), the site url is set in the config.php file. This file can be a great place to check when there are errors with the site as well. You can view and edit the site url and to set https in the file config.php located in the main app directory as shown below:

Screen_Shot_2022-05-12_at_10.03.19_AM.png

 

wwwroot and dataroot

wwwroot is where the site url is stored. View or edit the site url in config.php as shown below in wwwroot. There is also an associated data folder set in dataroot in case that needs adjusting or there are related errors. Take care not to delete the single quotes surrounding the set values, nor the semicolon at the end! That can cause the site not to load with errors.

$CFG->wwwroot   = 'https://moodle.pjova.reclaim.hosting';
$CFG->dataroot  = '/home/pjovarec/moodle.pjova.reclaim.hosting/.htxww4ltfa3ajr.data/';

For more information see: Moodle Configuration file config.php

 

Set up HTTPS

On a basic Moodle site, it will be simple to set up https. Simply edit config.php and change http:// to https:// in $CFG->wwwroot for your site url such as this example:

$CFG->wwwroot = 'https://moodle.pjova.reclaim.hosting';

From there, you can force HTTPS, and also ensure all your content is using https by referencing the following: Moodle Transitioning to HTTPS

 

Was this article helpful?
0 out of 0 found this helpful

Articles in this section

Reclaim Hosting Support Hours
8:00 am - 5:00 pm ET, Monday through Friday
Submit a Ticket
Get a quick and helpful response from the pros.
Need Extra Support?
No problem, we're here to help! Talk to us about Professional Services or custom Service Level Agreements.