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:
- Override the Alternate Login URL in config.php file – In this case you need to add “$CFG->alternateloginurl = ”; ” and save it.
- 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.