Entered in my URL in $CFG->wwwroot = then changed back to Localhost...now moodle site is messed up

Entered in my URL in $CFG->wwwroot = then changed back to Localhost...now moodle site is messed up

by Gabriel Joel -
Number of replies: 3

Hi,

I am new to this, hopefully someone can help...heres what I did. I am using the complete windows package 19.0.1 or something. I opened the config.php file and I changed $CFG->wwwroot = 'localhost' to $CFG->wwwroot = 'www.mysite.com"

Just to see what would happen...then I switched it back to $CFG->wwwroot =localhost. and when I tried to access localhost in my webbrowser my moodle site came up but it was all messed up and it wont let me log in. Instead it says "object not found! requested URL not found on our server...

All i did was change the config.php file from localhost to www.mysite.com and then back to localhost again... whats wrong how can i get my moodle site back again!?!?! let me know, I would really appreciate it!

Gabe

Average of ratings: -
In reply to Gabriel Joel

Re: Entered in my URL in $CFG->wwwroot = then changed back to Localhost...now moodle site is messed up

by Mathieu Petit-Clair -
Picture of Core developers Picture of Moodle HQ Picture of MoodleCloud team Picture of Plugin developers Picture of Testers
Maybe ... Empty the cache of your browser, try to force-reload the page ... It could be a cache issue.

Mathieu
In reply to Gabriel Joel

Re: Entered in my URL in $CFG->wwwroot = then changed back to Localhost...now moodle site is messed up

by Gary Anderson -
Gabe:

Make sure you use:

$CFG->wwwroot = 'http://localhost';

not

$CFG->wwwroot = 'localhost'

--Gary

BTW: I just put in $CFG->wwwroot = 'http://'.$_SERVER['SERVER_NAME'];

In that case, it fills in the correct address that you typed in whether it be localhost, an IP address, or any other valid address. There are a couple of caveats of using this method, by it is mostly on the administrator end (like calling the cron with the FQDN, copying in URL's with the full name, etc.)

In reply to Gary Anderson

Re: Entered in my URL in $CFG->wwwroot = then changed back to Localhost...now moodle site is messed up

by Balu Ertl -
Thanks Gary, Your little trick whit this environmental variable was exactly what I was looking for, it helped me a lot!