After Moodle elearning system update, the redirection from http to https is not working anymore.
Environment: Debian 9, Bitnami Moodle appliance, Apache web server
Port 80 and 443 are opened in firewall. You can access the web site via https and it's working.
I tried this https://docs.bitnami.com/installer/apps/moodle/#how-to-force-https-redirection-with-apache with no effect.
Everytime I enter URL without https, I get
Bad Request Your browser sent a request that this server could not understand. Reason: You're speaking plain HTTP to an SSL-enabled server port. Instead use the HTTPS scheme to access this URL, please.
This is from apache log:
[Wed Aug 08 16:16:45.827527 2018] [mpm_event:notice] [pid 3827:tid 140588913918464] AH00491: caught SIGTERM, shutting down
[Wed Aug 08 16:16:49.917673 2018] [ssl:warn] [pid 4503:tid 140413525754368] AH01909: localhost:443:0 server certificate does NOT include an ID which matches$
[Wed Aug 08 16:16:49.954349 2018] [ssl:warn] [pid 4504:tid 140413525754368] AH01909: localhost:443:0 server certificate does NOT include an ID which matches$[Wed Aug 08 16:16:49.966243 2018] [mpm_event:notice] [pid 4504:tid 140413525754368] AH00489:Apache/2.4.29 (Unix) OpenSSL/1.0.2n configured -- resuming norm$
[Wed Aug 08 16:16:49.966287 2018] [core:notice] [pid 4504:tid 140413525754368] AH00094: Command line: '/opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/ap$
I also tried to modify /opt/bitnami/apps/moodle/conf/httpd-prefix.conf with this lines:
DocumentRoot "/opt/bitnami/apps/moodle/htdocs"
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) http://www.moodle.mysite.com/$1 [R,L]
Include "/opt/bitnami/apps/moodle/conf/httpd-app.conf"
Didn't help. After every change I restarted Apache, deleted browser cache and tried to load the web page.
Thank you.