After logging in, it does not redirect to https

Install and configure FormaLMS and DoceboCE
Post Reply
urteam
Newbie
Posts: 3
Joined: Fri Oct 05, 2018 1:18 pm
Version: forma.lms 2.0

After logging in, it does not redirect to https

Post by urteam » Fri Oct 05, 2018 1:57 pm

Hello,
We have been Docebo users since 2008 but noticed that an upgrade was necessary, so we have recently downloaded and installed FormaLms Version 2.0. It looks great.
During the installation we set the URL with "https". We’ve been dealing with the .htaccess file so the URL resolves correctly with https:// and http://. So far, the http:// redirects to the https://, but after logging in, it does not redirect to the https:// anytime. As well as when logging out. We have reviewed the forum searching for any tip to fix it, but We've not found any yet.
We would appreciate any help.

alfa24
FormaLms Expert
Posts: 234
Joined: Fri Nov 24, 2017 8:45 am
Version: forma.lms 1.4.2

Re: After logging in, it does not redirect to https

Post by alfa24 » Fri Oct 05, 2018 2:08 pm

post your .htaccess file in root folder
I'm Jasmines, the One

urteam
Newbie
Posts: 3
Joined: Fri Oct 05, 2018 1:18 pm
Version: forma.lms 2.0

Re: After logging in, it does not redirect to https

Post by urteam » Mon Oct 08, 2018 2:27 pm

Hello,
Thank you.
Due to your request I noticed that in root folder there is a .htaccess file, but where Formalms is installed at, (htdocs/formalms/) there is other file. So the first file is:
Options -Indexes
The second one is this:
Options -Indexes
#no need to follow symbolic links in standard configuration
#Options +FollowSymLinks
DirectoryIndex index.php index.html index.htm

<Files favicon.ico>
ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /formalms/
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

<FilesMatch "\.(htpasswd|ini|php|fla|psd|log|sh)$">
Order Allow,Deny
Deny from all
</FilesMatch>

<FilesMatch "(composer\.(json|lock))$">
Order Allow,Deny
Deny from all
</FilesMatch>

<FilesMatch "((?i:readme)\.(?i:txt|md)|(?i:README))$">
Order Allow,Deny
Deny from all
</FilesMatch>

<FilesMatch "(index\.php|ajax\..*\.php|paypal\.php|cron\.php|tasks\.php|tinymce\.gzip\.php|index_tiny\.php|scormXmlTree\.php|soaplms\.php|scorm_page_body\.php|keep_alive\.php|text\.php|users\.php|write\.php|check\.php)$">
Order Allow,Deny
Allow from all
</FilesMatch>
I would like to clarify that mysite redirects from http://mysite.com to https://www.mysite.com, but from http://www.mysite.com it does not redirect to https://www.mysite.com

alfa24
FormaLms Expert
Posts: 234
Joined: Fri Nov 24, 2017 8:45 am
Version: forma.lms 1.4.2

Re: After logging in, it does not redirect to https

Post by alfa24 » Mon Oct 08, 2018 3:20 pm

Try replacing

RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

with:

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
I'm Jasmines, the One

urteam
Newbie
Posts: 3
Joined: Fri Oct 05, 2018 1:18 pm
Version: forma.lms 2.0

Re: After logging in, it does not redirect to https

Post by urteam » Mon Oct 08, 2018 8:07 pm

Thank you
I had to change RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] to RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] because it duplicates www.
After changing the rule I received a too many redirects error.

Post Reply