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.
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
Please post your solutions in the comments for the same problem if its different then the above two solutions.