Secure cookies in Moodle

Re: Secure cookies in Moodle

by Ryan Larkin-Smith -
Number of replies: 0
Thank you Adam, This seems to have worked. I entered the s into the config.php file in the root level and it changed it all to https. I tried to set up the htaccess rewrite, by looking into myapache and found the below lines of code, which I modified and tried to install, but don't understand what else I need to add to the file in terms of tags to make it work. I replaced the "server_name" with my domain but did not work, kept getting an error 500 or 403.

The good news is I am using my root for my entire system and it is all encrypted now. Thanks, Wanted to share the below if others find it helpful.

## REQUIRE SSL EVEN WHEN MOD_SSL IS NOT LOADED ###
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]


=========================================================#
SSL SECURITY
=========================================================#
-> http://www.askapache.com/htaccess/ssl-example-usage-in-htaccess.html
##########

## MOST SECURE WAY TO REQUIRE SSL ###
-> http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html
SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "domain.tld"
ErrorDocument 403 https://domain.tld