When managing a Moodle site, there are reasons to make the entire Moodle site work on an https:// connection. This will make all data transmitted over the site to be encrypted on an SSL connection. To achieve this, the Moodle config.php file will need to be edited and the .htaccess will need to have a redirect set up to force the https:// to load. The following tutorial will explain how to force Moodle 2.3 to work over an SSL connection.

Forcing SSL on https for Moodle

  1. Log into cPanel
  2. force-ssl-1-non-moodleNavigate to the config.php file in the File manager.

    Look for the line 17 (on default config files) that shows:

    $CFG->wwwroot   = 'http://yourdomain.com';
    

    force-ssl-2-ssl-moodle Change the http:// to https:// like the following:
    $CFG->wwwroot   = 'https://yourdomain.com';
    

     


  3. force-ssl-3-htaccess-moodleNext, Set up a redirect in your .htaccess file. Place the following code to force the https:// redirect.
    RewriteEngine On 
    RewriteCond %{SERVER_PORT} 80 
    RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
    
    Save the .htaccess file.

This concludes the article on Forcing Moodle 2.3 to work over SSL. For more information on this Education course please visit Moodle site security and server settings

Like this Article?

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

I'm James Richardson, your friendly Community Support technician, and I wrote the article you're looking at now. I like to think it's perfect, but I'm sure you have some suggestions. Please, let me know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

Latest Questions

If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)
Ask a Question!
Recent Questions
  1. Please help--I'm trying to get a script to work.
  2. i would like to know how to set up phpmailer to email from a mysql database
  3. I can't access my website

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!