This problem started after I renewed the domain's SSL. When I installed moodle on the subdomain, the website was already on HTTPS. This subdomain remained on HTTP. Upon renewing the main domain's SSL, this subdomain started redirecting to HTTPS but would wasd not displaying properly. The SSL for the main domain does not include this subdomain. So I purchased an SSL for this subdomain. Now the site works well, every URL works except the login which shows a duplicate domain name and no login form (Linux server, Moodle 4.01, Academi theme)
The moodle site is set on a subdomain. When I hover over the login link, I can see at the bottom left corner that it points to https://elearning.kaumbasecondary.org/login/index.php. But when I actually click on it the URL in the address bar is: https://elearning.kaumbasecondary.org/elearning.kaumbasecondary.org/login/ and the login form is not displayed, the duplicate URL loads the home screen.
Somehow, https://elearning.kaumbasecondary.org redirects to https://elearning.kaumbasecondary.org/elearning.kaumbasecondary.org/login/ . I have to delete the duplicate domain from the URL to get the site to display the login page.
I turned on debugging to display all errors but no error is shown for this. I tested the debugging by messing up with the webroot and sure enough, the site spat errors right in the browser. So whatever is causing this is not showing in the PHP error log.
What could be happening?