Hello, everyone.
I'm new to this forum, and registered because I have a redirect loop problem (errorcode 303) with one of the Moodle sites we are hosting.
site: course.nsp.as
version: Moodle 4.1.9+ (Build: 20240322)
problem: course.nsp.as/ redirects to course.nsp.as/login/index.php which redirects back to course.nsp.as/ in an infinite redirect loop. Errorcode 303.
What did I do to cause this problem? I logged in as an administrator and navigated to Site Security Policy settings. I did a few adjustments to some settings and saved changes.
These settings was changed:
Allow indexing by search engines was set to 'Nowhere'
Open to search engines was set to 'No' (or perhaps it was this as default, don't remember)
Force users to log in to view user pictures was set to 'Yes'
Force users to log in - I believe this already was set to 'Yes' before I changed anything.
After saving these settings I tried out a link a customer sent us that was pointing to a course entry page on the site. This link showed up after a Google search. They asked if it was possible to not show this link in Google - so I tried these settings above.
Result: An inifinte redirect loop was created. (Errorcode 303)
Some actions I have already tried to solve this (I am no longer able to log in due to this loop):
- I have run purge_cache.php from admin/cli - no effect
- I have renamed the following folders in moodledata: cache, localcache, muc, sessions, temp, trashdir - no effect
- I activated debugging mode in config.php (copied code from chap 7 in config-dist.php) - no effect - no debug-messages shown due to loop.
- When I rename config.php the site throws a different error, so apperently config.php is at least run.
- Copied index.php from a different site. Both index.php in root folder and in login folder. - no effect
- Have tried out some changes in both these mentioned index.php files. - no effect
- Commented out line in admin/index.php with redirect (after tip from searching on redirects problems)
- I wanted to try complete restore from backup - but it was a problem with disk size (running on Cloudways) - not enough disk space to do a full restore, and I was hoping to avoid the cost of scaling up as monthly cost nearly doubles. I tried to restore only database - no effect. I tried to restore only webfiles - which instead of redirect loop throw a fatal error - I can post this error when I'm back at the office. But interesting fact that instead of redirect loop a fatal error was thrown. I rolled back from restore both times.
I have tried some other actions too - but these are the first that comes to my mind. Very frustrating as this is a server with quite much traffic.
What files are altered by Moodle when these settings are adjusted in site security policy settings? I have searched the web for redirection loop problems, and it seems most of them are related to new Moodle installations. Has anyone encountered the problem I describe above? All help is very much appreciated!
Terje.