Fix MANY REDIRECTS problem, after update

Fix MANY REDIRECTS problem, after update

by WADHWA WADHWA -
Number of replies: 1

Hello,

After updated Moodle 3.5 to 3.6 getting looping redirect.

Error:
ERR_TOO_MANY_REDIRECTS

When opening site  looping redirect like:  site.com  goes to  site.com/login/index.php and again back ++ loop

 P.S.
Already tried 
- Delete moodledata/cache/ moodledata/localcache/ moodledata/muc/ moodledata/sessions
Admin folder index.php file comment  redirect(“index.php?sessionstarted=1&lang=$CFG->lang”);

Average of ratings: -
In reply to WADHWA WADHWA

Re: Fix MANY REDIRECTS problem, after update

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

If Force users to log in was enabled and Alternate login URL was set to the site's home page then this would cause a loop between these two pages. You can check this in the database:

SELECT name, value FROM mdl_config
  WHERE name IN ('forcelogin', 'alternateloginurl');
+-------------------+------------------+
| name              | value            |
+-------------------+------------------+
| alternateloginurl | https://site.com |
| forcelogin        | 1                |
+-------------------+------------------+

If this is the case you can override these settings by adding the following to config.php:

$CFG->alternateloginurl = '';
$CFG->forcelogin = 0;

The other cause of this error is when a reverse proxy is being used but normally the loop is to the same URL only. If this was the case, $CFG->reverseproxy = true would need adding to config.php.

Average of ratings: Useful (1)