‘This webpage has a redirect loop’ or ‘The page isn’t redirecting properly’ with fresh installation

Today while testing out a fresh installation of Moodle 2.7 I came across the error ‘This webpage has a redirect loop’ due to which I was not able to enter the Moodle site as admin and can’t change anything even after clearing the browser cache and changing the browser also.

Redirect Loop Error
Redirect Loop Error

Doing a quick search on Moodle forums provide me few solutions which helped in resolving the error instead of going for a fresh install again, so I am reposting it here.

1. The first solution which worked for me was to commenting out the line number 451 of file yourmoodledirectory/admin/index.php file as:


2. and the second solution includes to Delete all the contents of Cache and Session directory in your moodledata directory and restart the browser.



For solution 1: https://moodle.org/mod/forum/discuss.php?d=230067#p1044795

For solution 2: https://www.lisenet.com/2014/fix-this-webpage-has-a-redirect-loop-moodle-v2-7/

Please post your solutions in the comments for the same problem if its different then the above two solutions.

Jaswinder Singh

Jaswinder Singh, passionate about using Moodle in improving the Indian Education System and reaching the students in far flung areas where still education seems to be a impossible prospect of life. He is the author of the popular Moodle Book "How to use Moodle 2.7". In October 2016, Jaswinder was elected as the Moodle User's Association Committee member - the first to make it from India.

Related Articles