How to switch a Moodle website to https?

  1. Update the config.php file in the Moodle root directory to include the following lines:
$CFG->wwwroot = 'https://example.com';
$CFG->httpswwwroot = 'https://example.com';
$CFG->httpsadmin = true;
  1. Replace example.com with your actual domain name.
    • You may also need to update the httpswwwroot and httpsadmin parameters if you use a different domain name for your Moodle administration area.
  2. Replace all occurrences of http:// with https:// in your Moodle templates, CSS files, and other static files.
    • You can manually replace the http:// prefix or use a search and replace tool to ensure all links utilize HTTPS.

Leave a Reply

Your email address will not be published. Required fields are marked *