ERR_TOO_MANY_REDIRECTS

ERR_TOO_MANY_REDIRECTS

by Simon Fraser -
Number of replies: 53

My site, mis.caribbeanmis.com is hosted on Bluehost.  It worked fine up until this morning and then students started saying they could not log in.  My first look was on my iPhone running the latest version of iOS.  When I tried to log in it said that I was already logged  in and that I needed to log in as a different user.

The home page displays fine. But when you to 

http://mis.caribbeanmis.com/login/index.php

that's where the problems start.

I then tried logging in using Chrome, Firefox and IE on Windows 7 and Edge on a Window 10.


The site is running Moodle 3.0.4

In Chrome:

mis.caribbeanmis.com redirected you too many times.

ERR_TOO_MANY_REDIRECTS

In Firefox:
The page isn’t redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    This problem can sometimes be caused by disabling or refusing to accept cookies.

IE 

This page can’t be displayed

This page can’t be displayed
  • Make sure the web address http://mis.caribbeanmis.com is correct.
  • Look for the page with your search engine.
  • Refresh the page in a few minutes.


  • I have not made any config changes.
  • I have tried deleting my cookies in my browser and deleting the cache and session data in the moodledata directory on the site. 
  • I have also experimented with commenting out redirect("index.php?sessionstarted=1&lang=$CFG->lang"); in the index.php in the moodle admin directory.
  • I have asked Bluehost to restore the full site - files and databases.


I am pretty sure something in the hosting environment changed because I didn't update moodle or mess with any of it's config settings.

So ..... where do I look?  I just need this site to limp along for another eight weeks then I am moving. But in the meantime I would like to be able to log on.


Thanks in advance.


Average of ratings: -
In reply to Simon Fraser

Re: ERR_TOO_MANY_REDIRECTS

by Simon Fraser -

One more oddity. When I log in and get the "you are already logged in...." It shows my name up at the top right and I can still navigate the the course by going into my profile and selecting the course from the my courses link on the menu.

In reply to Simon Fraser

Re: ERR_TOO_MANY_REDIRECTS

by Usman Asar -
Picture of Plugin developers Picture of Testers

Simon, bluehost did a mega storage upgrade this Friday, chances are few things may have been altered, try looking into your REDIRECTS if there is any, also if you're on Cloud Sites, do check if your Cache is enabled, turn that off.

In reply to Usman Asar

Re: ERR_TOO_MANY_REDIRECTS

by Manish Chandra -

Confirming similar behavior of moodle 3.1 with bluehost. Even the home directory was altered from home2 to home1. Although, i have modified config.php, problem still persists.

site is inaccessible.

In reply to Manish Chandra

Re: ERR_TOO_MANY_REDIRECTS

by Tamilselvan Mahalingam -

Just got off the phone with their support, no solution from them. Everything seems to be fine from their end !!!

In reply to Usman Asar

Re: ERR_TOO_MANY_REDIRECTS

by Simon Fraser -

Hi Usman.

Where do I look for the redirects?  In the moodle code or in some configuration files?

In reply to Simon Fraser

Re: ERR_TOO_MANY_REDIRECTS

by Usman Asar -
Picture of Plugin developers Picture of Testers

Simon, you'll find redirects in CPanel, as shown in image attached


just see if there is any redirect mentioned.

also, if it's cloud sites account you have, try disabling and deleting cache.


In reply to Usman Asar

Re: ERR_TOO_MANY_REDIRECTS

by Simon Fraser -

I checked there. No redirects.  And, as far as I know, I have the standard Bluehost package I signed up for ten years ago


In reply to Simon Fraser

Re: ERR_TOO_MANY_REDIRECTS

by Usman Asar -
Picture of Plugin developers Picture of Testers

Do check directory permissions as well, if  they may have changed, they should have to be 0755 for root and as well all folders inside, besides check your .htaccess file for anything unusual.

you can always remove the sub-domain and allocate once again to see if something has been altered during storage upgrade, removing sub domain will not delete the folders.

In reply to Simon Fraser

Re: ERR_TOO_MANY_REDIRECTS

by Tamilselvan Mahalingam -

Hi Simon,

Did you find a solution to this problem. I'm facing exactly the same problem. I see that your site is up and running again. Please provide me the solution if you can.

Thank you

In reply to Tamilselvan Mahalingam

Re: ERR_TOO_MANY_REDIRECTS

by Simon Fraser -

No solution as yet.  Will let you know if and when I do find one.

Thank god the semester is over and all the assignments and grading have been completed. I have been planning to move to another host - just not quite so soon.  I guess this is the kick in the backside that I needed.

In reply to Simon Fraser

Re: ERR_TOO_MANY_REDIRECTS

by Simon Fraser -

Some forwardprogress with help from Bluehost.  Anyhow, the support rep I got this morning seemed to know what he was about.  Anyhow, I can log in again - he said it seemed like a domain caching issue.  Anyhow, I am awaiting an explantion.


However, I am not out of the woods yet.

  1. In one course, I keep getting told that I am already logged in as me and that I need to log out and log in as another user!!!
  2. In  second course, I can get to the course but the profile that is displayed belongs to a student - so I can't see any admin menu items.

I have cleared my browser cache and cookies several times but these two problems persist.

At this point, I am backing up like crazy and have opened an account on SiteGround.  I am going to manually install the current stable Moodle and try to restore my backups there.  Bluehost is taking years off my life.

In reply to Simon Fraser

Re: ERR_TOO_MANY_REDIRECTS

by Usman Asar -
Picture of Plugin developers Picture of Testers
Simon, just before you do fresh install, try deleting "cache" and "localcache" folders from moodledata folder, and see if it makes ANY difference, reloading moodle with automatically re-create those folders so dont worry about deleting them.
You can as well go inside session folder and delete all the files (you'll be logged out of moodle after that).

In reply to Simon Fraser

Re: ERR_TOO_MANY_REDIRECTS

by Joshua Hunyadi -

Bluehost... same problems here. I've had problems like this with them for a while now. Bluehost tells me they do not support Moodle, so anytime I have a problem they don't really help. I already purchased from Siteground and waiting until our school term ends in a month to make the change.

I was able to get back into my site. I think the key was when I turned off Cloudflare, but here is everything I did that may have had an impact (after scrambling for a day to figure out if I had backups):

  1. Upgraded from Moodle 3.1 to 3.2.2 Stable
  2. Cleared cache folders and sessions files through cPanel File Manager
    1. /home/~
    2. /moodledata
  3. cPanel > Domains > Cloudflare
    1. Disable
    2. This temporarily made my site inaccessible due to DNS change about 10 minutes

When the site came back, I finished the upgrade steps and it logged me back in.

It looks like it is back to normal now.

Cloudflare would not let me edit its settings on day 1 of this issue, so I bumped it down the list and came back to it.

In reply to Joshua Hunyadi

Re: ERR_TOO_MANY_REDIRECTS

by Joshua Hunyadi -

Nevermind.

I had some students log in and it says they are logged in as different students.

At least I can get in. I'm putting the site into maintenance mode. If I can't figure it out I will have to transfer to Siteground.

In reply to Joshua Hunyadi

Re: ERR_TOO_MANY_REDIRECTS

by Manish Chandra -

Thanks very much for the suggestions. Now, login page is back and working.

In addition, i used this desperate and dirty solution to get rid of login page redirect errors:

commented out these lines in /login/index.php.


I will wait for permanent solution.

In reply to Manish Chandra

Re: ERR_TOO_MANY_REDIRECTS

by Tamilselvan Mahalingam -
I spoke to bluehost support for about an hour from Dubai (around USD 100 telephone charges!!) and chat with about 3 support staff for about 45 minutes each. No solutions, each one gave me different reasons and explanation. In short, they are blaming Moodle.

This issue happened to be couple of days back in our lms learn.3foldtraining.com, for some strange reasons, i could able to login to this site using my Samsung Mobile, I took the opportunity to backup and download the course.

I deleted the moodledate and moodle software, and reinstalled freshly at the same learn.3foldtraining.com, the same problem persisted. I started to suspect if this has anything to do with subdomain....

Then I installed moodle in our main domain www.3foldlearn.com and redirected learn.3foldtraining.com.

But the stress I was in for the last 2 days was unbearable, as I have more than 800+ students enrolled in our courses.
In reply to Manish Chandra

Re: ERR_TOO_MANY_REDIRECTS

by Donna C -

Hi,

How did you get your login page back?   Was it from the above commented out lines?

Donna

In reply to Joshua Hunyadi

Re: ERR_TOO_MANY_REDIRECTS

by Joshua Hunyadi -

After some time, ERR_TOO_MANY_REDIRECTS returned. And my backups were giving errors. The following let me get back in to do new backups:

I changed config.php line

from:

$CFG->wwwroot   = 'http://subdomain.siteroot.com';

to:

$CFG->wwwroot   = 'http://siteroot.com/folder';

Then enter the updated URL in the browser. The site let me in... will have to test and see what's working.

In reply to Joshua Hunyadi

Re: ERR_TOO_MANY_REDIRECTS

by Joshua Hunyadi -

Seems to be working like this. This is not my first round of issues with Bluehost, so I just finished restoring everything to Siteground. I already see big speed improvements. Hope this one works out.

In reply to Joshua Hunyadi

Re: ERR_TOO_MANY_REDIRECTS

by dharmendra vadher -

Hey I am getting same ERR_TOO_MANY_REDIRECTS error

but not on web host I am installing it on windows pc having xampp server

Is there any solution of the error for the xampp server

Attachment Capture.JPG
In reply to dharmendra vadher

Re: ERR_TOO_MANY_REDIRECTS

by ABRAR HAIDER -

same problem here i have installed and configure the Moodle 3.7.2+ the current latest version  on LocalHost with Xamp server and i am having the same error after installation ,

Have you find any solution of that problem?

In reply to Joshua Hunyadi

Re: ERR_TOO_MANY_REDIRECTS

by Simon Fraser -

I Transferred to SiteGround. Spent the whole day but my site is up under a different domain.  

In reply to Simon Fraser

Re: ERR_TOO_MANY_REDIRECTS

by Simon Fraser -

after working for a few hours my site stopped working again.  At that point I decided to do a fresh install on SiteGround and restore my backups.  Things working beautifully now.  My original site is still down but at this point I have given up on Bluehost.

Thanks for all the suggestions.

In reply to Simon Fraser

Re: ERR_TOO_MANY_REDIRECTS

by Donna C -

The same thing happened to my site on Bluehost which uses moodle.


my site uses a single signon to get to each course.   Some users not getting into the course and it seems once it happens to one course then the same happens for all users enrolled in that course.  I have to back up the course, restore it into a new course to give them access. 

They either get the err_too_many_redirect message or the message which says they have to logoff because they are already logged in as another user.  which makes no sense.


Any way, in addition to that I have lost ability to access to the administrator link where I can reset someones password:  /admin/user.php  I copied and renamed it and the page loads but when I try to change a password I get the message about you have to logoff, et.

I would like to know why this is happening so I can fix it and I also need to know how to reset a password because it seems that is broke.


Any suggestions?


In reply to Donna C

Re: ERR_TOO_MANY_REDIRECTS

by Usman Asar -
Picture of Plugin developers Picture of Testers

Donna, seems like everyone started getting same  issue on BlueHost where one thing common I can see if BlueHost upgraded their storage this Friday so manually moved plenty of accounts and databases that may have lead to these issues commonly.

One thing, that I want to ask everyone having same issue as I am on BlueHost Cloud too and I hadn't had any issues, few more are on BlueHost that I know here haven't reported any too as I know at least about their Moodles that have been installed manually, so was mine.

Now a question to all effected, Simon, Joshua, Manish, Tamilselvan, Donna and everyone effected.

Have you people installed your moodle's using Mojo Market Place?

In reply to Usman Asar

Re: ERR_TOO_MANY_REDIRECTS

by Nausheen Sayed -

I am seeing same since 2 days sad

Unable to access our training portal. Bluehost purged the cache from server side - this momentarily bought the site up but then within an hour it all went down again. However when the site was up, there was some serious login issues. we tried all above solutions mentioned here and still trying other stuff.

@Usman - no I didnt use Mojo Market Place

In reply to Usman Asar

Re: ERR_TOO_MANY_REDIRECTS

by Donna C -
Usman,



Thank you for getting back to me. I installed moodle manually.



Sincerely,



Donna

The Wise DC, Inc.
In reply to Usman Asar

Re: ERR_TOO_MANY_REDIRECTS

by Joshua Hunyadi -

I installed manually. It seems Bluehost manually moves things and there have been previous changes to PHP and .htaccess without notification.

In reply to Usman Asar

Re: ERR_TOO_MANY_REDIRECTS

by Manish Chandra -

Hello Usman, I had installed Moodle using git.

My another Moodle install on another domain (also on bluehost) is also okay. Touch wood.

Hello Donna, little update: login page is inaccessible again.

In reply to Manish Chandra

Re: ERR_TOO_MANY_REDIRECTS

by Donna C -
Thank you Manish,

I used to hate getting that login screen when the single login failed.  Now I would give anything to see it again.
Donna
In reply to Manish Chandra

Re: ERR_TOO_MANY_REDIRECTS

by Usman Asar -
Picture of Plugin developers Picture of Testers

Manish, are both Moodle versions same?

Rest for everyone (Joshua, Donna, Nausheen) , seems like BH messed up during storage transfer. I did  find myself plenty of things reverted to default on transfer completion, so do have a look into your .htaccess files if they have initiated any redirects.

Try manually deleting the "cache" and "localcache" folders from moodledata folder on effected moodle, they will reappear on re-loading moodle so dont worry about deleting, also delete everything within sessions folder, do this while your moodle is on maintenance mode, this  will log you out as admin as well but you can always start a new session by logging in.

In reply to Usman Asar

Re: ERR_TOO_MANY_REDIRECTS

by Donna C -

Usman,

I checked the .htacces file and it has not changed.

I am running Moodle 2.0  .  I deleted the cache folder from datarootdir and still can't access the login screen. 

How do I delete the sessions in this version?

I guess I need to build a new site with the new version when this is all said and done.  I don't have access to the developer who  helped me set it up because he got a new job.  Any leads on someone who does this would be appreciated.

My site is up and running.  I have users registering for and taking classes.  I just fear that if the the single login fails from the billing software front end of my site and they get this screen instead of the login screen and then hit logout it will break the url for everyone else.

Currently, I have access to my moodle administration and I can do course and reporting functions but when I try to access http://www.thewisedc.com/lms/admin/user.php    I get this screen


Thanks, Donna

Attachment screen shot.jpg
In reply to Donna C

Re: ERR_TOO_MANY_REDIRECTS

by Usman Asar -
Picture of Plugin developers Picture of Testers

In older versions, session was saved in DB as I remember, it's since this newer ones 2.7+ you can find session folder inside of moodledata with files for every session intact.

Floyd Saner, one of our community members does takes works like that often, I'll privately message him too to take a look into your case, which payment system is integrated inside of your moodle?

In reply to Usman Asar

Re: ERR_TOO_MANY_REDIRECTS

by Donna C -

Thank you Usman,


I use Authorize.net which is inside of Agilebill which takes payment on the front end and then links from purchased products (courses) to moodle courses via protected directory access.  I am pretty familiar with the setup.  I have all of the documentation from the previous developer who did the integration so I know where all of the changes were even though I didn't do it myself.

Donna


P.S  Everything is working on the user end as far as I know but for me when I am working with moodle admin pages sometimes I get that strange page saying I am already logged in and I have to logout.  Then when I try again in another browser or on a different device it lets me in.  I don't want to empty a sessions table because I have many people working on courses as I can tell from the report logs.

In reply to Donna C

Re: ERR_TOO_MANY_REDIRECTS

by Usman Asar -
Picture of Plugin developers Picture of Testers

You can always put site in maintenance mode before proceeding session clearing task, as for your admin side, why dont try emptying your browser cache/cookies and see if things get normal.

As for upgrade, do at least to 2.7 that is baseline for upgrades to higher versions.

In reply to Usman Asar

Re: ERR_TOO_MANY_REDIRECTS

by Donna C -

Usman,

Thank you for your suggestions!  I will keep this in mind.  I am preparing for some scheduled off time so I am leaving things as is until I will be able to troubleshoot things.  Everything is calm on the user side for now.  I didn't see any htaccess files where they shouldn't be or anything changing to default like the other site owners.   However, on one of your posts you said that permissions should be 755.  My moodle folders are 755 but all of the php files inside are 644.  Is this normal?

Donna

In reply to Donna C

Re: ERR_TOO_MANY_REDIRECTS

by Usman Asar -
Picture of Plugin developers Picture of Testers

Absolutely normal, files assigned 644 permissions and folders 755, that is why I specified folders specially so users wont get confused.

Regarding seeing .htaccess files, when you click File manager, you'll see option in preferences, "show hidden files", selecting that will show you .htaccess  files of your account, redirects are mentioned in .htaccess files that is why I mentioned that to look into it, as when storage was moved, plenty of things were reverted back to default eventually bringing issues to users.

There could be more than one .htaccess file, whilst others will be with .bak in the end, you need to look into .htaccess only as it will be currently serving your server, also note than root files takes precedence, so as well look into folders of websites for .htaccess files too.

In reply to Usman Asar

Re: ERR_TOO_MANY_REDIRECTS

by Simon Fraser -

I am seeing about half a dozen .htaccess files in my Moodle directory. I did not put them there.

In reply to Simon Fraser

Re: ERR_TOO_MANY_REDIRECTS

by philipp lesmana -

...

same issue, also with bluehost.


At the moment, i can get into the actual pages if i go to them directly. To log in, i can go to www.yoursite.com/index.php , which then allows me to log in but then gives me another error. At this point, i can directly go to a course category page or something, and it will load. Basically, the main portal is the one that does all these redirect errors. 

Did anyone figure out the solution that works? 

I looked through the thread and no one seems to have a sticking solution?

In reply to philipp lesmana

Re: ERR_TOO_MANY_REDIRECTS

by Nausheen Sayed -

Our Issues magically resolved yesterday. We are able to view, login to our moodle site. We pestered bluehost for hours via live chat and call support. They said they cleared the varnish cache, not sure if that worked or they reverted some changes on their end. But finally our users can access our training portal. Had a rough week with this issue.

In reply to Nausheen Sayed

Re: ERR_TOO_MANY_REDIRECTS

by Usman Asar -
Picture of Plugin developers Picture of Testers

Varnish does effect mostly static portion of the site, together with some PHP code too, that is why I mentioned turning off cache's if someone is on Cloud Hosting Accounts with BlueHost as cloud accounts get options of enabling/disabling nginx/Varnish, rest others have to rely on hosting provider.

In reply to Usman Asar

Re: ERR_TOO_MANY_REDIRECTS

by sam K -

I have been having similar problems since the beginning of May

I am using Moodle 3.0

At first I got the ERR_TOO_MANY_REDIRECTS.  I found this thread and tried several of the fixes.

Finally I called HostMonster (I believe they are associated with Blue Host)  After a discussion, the tech said he would restore my site.  The next day everything worked.  The NEXT DAY I got into a different type of problem.

My homepage comes up with a student's name (before I log on)  My home page and THE SECOND class in my list seems to be taken over by this student's name.  Even when I sign on, if I go directly to these pages, I see his name.  The assignments on the 2nd class, show as if I am a student.  OTHER classes seem to work.  I see my name and admin tools in them.  When at the home page I see an OLD version of the home page.  I have made some additions to the class list since this has happened and none of them show.

If I click on the subcategory tag, I see my name and a list of all courses (including the new ones)

The second course is my largest course.  When things went bad, it had about 250 students in it.  One of my student suggested reducing the number of students so I deleted some names, but that doesn't seem to make any difference.

I have also SUSPENDED the account of the student whose name shows up on the home page.  

I also tried making him an administrator.  I did the following.  I changed the name  slightly.  When I logged out and went to the home page.  I saw the OLD name.   When I tried to log out, I get the menu item and logged out, but was not able to get a login link UNTIL I went off the home page.   Then I was given the You are not logged on message and was able to log on as him.  I logged in with his slightly changed name and new administrator privileges.  On the home page, I will saw the old name (and also in the 2nd course) .. Everywhere else I now see his new name.

Somehow it appears that the Home page (and the 2nd course) are unreachable by normal links.

I was able to create a copy of the bad class and it seems to work, but all the students work in still in the original version and is not accessible.

How do I fix my home page.

How do I recover the 2nd class.

I am including a couple of screen shots.

In reply to sam K

Re: ERR_TOO_MANY_REDIRECTS

by Usman Asar -
Picture of Plugin developers Picture of Testers

Sam, indeed hostmonster/bluehost are exactly same companies operating same data centre and having same office address, It may seem like during storage transfer (which they must have done as well) database transfer may have corrupted the databases of many sites. that is why you're seeing different FORD than it use to be as this information comes out of DB and not the site, wheree HM's support did restored your site (that may include moodle and moodledata folder), what actually he was suppose to restore was database which looks like main cause of issues.

If, you can and have courses backed up prior to last Friday's (April 28th) transfer/upgrade of storage, I would definitely recommend starting from a new installation, and restore courses with users intact. it may take a day or two for you to come back to normal operations, but it would be worth it.


In reply to Nausheen Sayed

Re: ERR_TOO_MANY_REDIRECTS

by Simon Fraser -

Things seemed to work for a while but it's back down again.

In reply to Simon Fraser

Re: ERR_TOO_MANY_REDIRECTS

by philipp lesmana -

So a little update to those more knowledgeable than me : 


while the main page mydomain.com gives ERR_TOO_MANY_REDIRECTS , I successfully loaded mydomain.com/index.php


From here, I would try and log in, however it would fail to load the next screen as it would try and redirect to : mydomain.com/login/index.php  <--- why does it do this???


In fact, it succeeded in logging in, because if I then load : mydomain.com/course/ , i will find myself successfully logged in. 


I am wondering if i should simply redirect to mydomain.com/course for the time being. 



EDIT: 

Which would not work - because even when logging in at mydomain.com/course/ , it still redirects back to mydomain.com/login/index.php initially. 


In reply to Simon Fraser

Re: ERR_TOO_MANY_REDIRECTS

by Usman Asar -
Picture of Plugin developers Picture of Testers

Simon, have you moved your site intact to siteground? As I had mentioned, issue isnt with BlueHost current configuration, but during transfer some files/DB may have gone corrupted.

If you can, I would recommend installing a fresh moodle and see if things go well.

In reply to Usman Asar

Re: ERR_TOO_MANY_REDIRECTS

by Joshua Hunyadi -

I have successfully transferred to Siteground. I anticipated what you described and installed fresh, then restored course backups.

Initially, my course backups would not install due to having a duplicate admin username. I changed the new site's admin name and it restored within minutes. The only issue I see now is many missing images (which was a previous problem that Bluehost could not help with, so it might not be from this recent issue).

Unfortunately, I don't think I will be much help to those who stay with Bluehost since I had to leave to get my site back up.

Thanks to everyone for your ideas and for your help.

In reply to Joshua Hunyadi

Re: ERR_TOO_MANY_REDIRECTS

by Usman Asar -
Picture of Plugin developers Picture of Testers

may be your MIME type arent setup correctly, try capitalizing image extensions, where its with .jpg, try .JPG

In reply to Simon Fraser

Re: ERR_TOO_MANY_REDIRECTS

by Жукова Екатерина -

About  ERR_TOO_MANY_REDIRECTS problem:

I'm from Russia and when there was a similar problem with the moodle, I received such a response from the hosting company

"Planned work was done, during which php was switched to FastCGI mode.

Perhaps the problem you described is caused by the fact that the current version of the PHP 5.5 interpreter that was installed on your service is built with OpCache support, that is, the server is cached bytecode. As a solution translated php on your service to version 5.4 "

Average of ratings: Useful (1)
In reply to Simon Fraser

Re: ERR_TOO_MANY_REDIRECTS

by Сергей Сидельник -

Hi! This solved my problem 

Average of ratings: Useful (1)