HTTPS change in config.php - Too many redirect error

HTTPS change in config.php - Too many redirect error

by Kushan Rathnasekara -
Number of replies: 10

Dear Sir / Madam,

I installed a SSL certificate and convert to my moodle site to HTTPS://.

Edit the config.php and changed HTTP// to HTTPS:// as follows.

$CFG->wwwroot   = 'https://www.elead.lk/lms';

Now site is down and "too many redirect" error message is coming.

Really Really Appreciate your co-operation to sort out the matter.

Thank you so much !







Average of ratings: -
In reply to Kushan Rathnasekara

Re: HTTPS change in config.php - Too many redirect error

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Have you also updated your webserver config? Did you run the replace tool on your database? "yoursite"/admin/tool/replace/index.php
In reply to Emma Richardson

Re: HTTPS change in config.php - Too many redirect error

by Kushan Rathnasekara -

Dear Madam,

Thank you so much for the feedback.

Could you please guide me how i can edit the webserver configuration and what to change ?

Really appreciate your guidance..

Thank you so much...

Good Day .. Stay Safe...

Kushan







In reply to Kushan Rathnasekara

Re: HTTPS change in config.php - Too many redirect error

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
This often happens due to a mismatch between the web server configuration and Moodle configuration. What happens if you copy a HTML file, say test.html, to the Moodle code directory - that is where the config.php is - and visit https://www.example.com/lms ? (replace example.com with your domain)

N.B. Keep your Enter key under control for less scrolling.
wink
In reply to Visvanath Ratnaweera

Re: HTTPS change in config.php - Too many redirect error

by Kushan Rathnasekara -
Dear Sir,

Thank you so much for the feedback.

Could you please guide me step by step what should I do to do web server configuration please ?

Really appreciate your guidance..

Thank you so much...

Good Day .. Stay Safe...

Kushan
In reply to Kushan Rathnasekara

Re: HTTPS change in config.php - Too many redirect error

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

Moodle requires a working web server. See https://docs.moodle.org/en/Installing_Moodle#Requirements. How to set up such a server is outside the scope of Moodle. To check whether the web server points to the correct directory, copy a HTML file, say test.html, to the Moodle code directory - that is where the config.php is - and visit the URL where your Moodle site is expected, https://www.example.com/lms/test.html in your case. (replace example.com with your domain)

P.S. From my side your site seems to be working. I got the login box, chose Login as guest and can see a fresh Moodle site. Did you try purging your browser cache? Or try from another browser or a different device.
In reply to Visvanath Ratnaweera

Re: HTTPS change in config.php - Too many redirect error

by Kushan Rathnasekara -

Dear Sir,

Thank you so much.

Actually when i change the config.php as follows and change the HTTP// to HTTPS:// the site returned too many redirect error.

$CFG->wwwroot   = 'https://www.elead.lk/lms';

Then I revert the change and keep the http as it is as follows.

$CFG->wwwroot   = 'http://www.elead.lk/lms';

Then site works without an issue. But under moodle testing HTTPS test is failed and social login (specially FB login) cannot be set as it says the my moodle doesn't have HTTPS.

Even moodle docs it says once we install a SSL, then config.php should be edited as i did to HTTPS://. However it creates too many redirect error.

Pls assist me and really appreciate your expert views to solve the matter as early as possible.

Thank you very much !

Kushan

In reply to Kushan Rathnasekara

Re: HTTPS change in config.php - Too many redirect error

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Your problem is not related to Moodle. You want you Moodle site to go on-line as https://www.elead.lk/lms? Then, copy a HTML file, say test.html, to the Moodle code directory - that is where the config.php is - and visit the URL https://www.elead.lk/lms/test.html. You should see the content of the test.html rendered. As long as that doesn't happen, forget Moodle.

P.S. From my side your site seems to be working. I got the login box, chose Login as guest and can see a fresh Moodle site. Did you try purging your browser cache? Or try from another browser or a different device.

P.P.S. This topic is not about security, it belongs to the Installing and upgrading help forum.
In reply to Visvanath Ratnaweera

Re: HTTPS change in config.php - Too many redirect error

by Kushan Rathnasekara -

Dear Sir,

Thank you for the feedback.

Actually when i change the config.php as follows and change the HTTP// to HTTPS:// the site returned too many redirect error.

$CFG->wwwroot   = 'https://www.elead.lk/lms';

Then I revert the change and keep the http as it is as follows.

$CFG->wwwroot   = 'http://www.elead.lk/lms';

Then site works without an issue. But under moodle testing HTTPS test is failed and social login (specially FB login) cannot be set as it says the my moodle doesn't have HTTPS.

Even moodle docs it says once we install a SSL, then config.php should be edited as i did to HTTPS://. However it creates too many redirect error.

Pls assist me and really appreciate your expert views to solve the matter as early as possible.

I forwarded the issue to  Installing and upgrading help forum as well.

If anyone can help pls guide.

Thank you so much !

Kushan




In reply to Kushan Rathnasekara

Re: HTTPS change in config.php - Too many redirect error

by Ken Task -
Picture of Particularly helpful Moodlers

You are hosted on a server that evidently is behind Sucuri/Cloudproxy According to what I can find ... There are 7,229 domain names hosted on this IP address

You have a WordPress site above 'lms' where the moodle code resides.

Check Sucuri config and WordPress config as well.

Don't ask me how to check Sucuri ... don't use it myself.   Also I don't have a WP in front of any Moodle to avoid issues WP could cause if it has rules that affect the 'lms' directory under it.

'SoS', Ken

Average of ratings: Useful (1)