Locked out of Moodle? How to fix Alternate Login URL error to log in to your Moodle site?

Moodle LMS is one of the most popular open source Learning Management System in the world. It is being used by more than 330 million users across 242 countries around the world. Moodle contains many features which are not known to many new Moodle administrators. In this post, we will discuss about Alternate Login URL setting in Moodle and how you can fix that in case you are locked out of Moodle due to improper configuration.

Alternate Login URL setting in Moodle allows you to configure an outside page which will be used for login purpose. It might be taking you to another provider for SSO purpose or you can make a completely new page with a form to login to Moodle. You can also have a look at Splash Login plugin which provides a custom splash page that only shows the IDP/SSO buttons and (optionally) a link to the manual Moodle login form.

Please note that before testing out this setting you need to make sure to enter a correct working URL otherwise you might get locked out of Moodle completely. You can mention an absolute URL in this field or a relative URL. In case you are specifying a relative URL then make sure it will be with respect to your wwwroot specified in config.php file.

How to fix incorrect alternate login URL in Moodle?

I was also trying to create a custom login form on my development moodle site and was locked out of Moodle. The incorrect URL setting leads to many redirects without actually loading the Login page. After going through a couple of Moodle forum topics, I figured out the solution.

There are two ways to address this problem:

  1. Override the Alternate Login URL in config.php file – In this case you need to add “$CFG->alternateloginurl = ”; ” and save it.
  2. Override the Alternate Login URL in the database – in the mdl_config table override the value for the alternateloginurl

Once you are done save your changes and now you should be able to login to your Moodle site again. What are your experiences with Moodle Alternate Login URL setting? Please share with us in the comments section below.

Related articles

Moodle Plugins directory now read only – Moodle Marketplace releasing on July 20th

Moodle Plugins directory which has been the backbone of...

Join MoodleMoot Global 2025 in Edinburgh UK from 16-18 September 2025

MoodleMoot Global 2025 will take place from in Edinburgh...

Join MoodleMoot Australia 2024 on 26-27 November 2024 in Melbourne

MoodleMoot Australia 2024 will take place on 26-27 November...

Participate in Moodle 4.5 QA Testing to contribute for a future LMS

Moodle 4.5 is the next LTS (Long Term Support)...

Case Studies