How to configure Moodle to work with a new domain?
To configure Moodle to work properly with another domain, modify the config.php file located Moodle’s main folder.
Change this line:
$CFG->wwwroot = ‘http://olddomain.com‘ ;
to
$CFG->wwwroot = ‘http://newdomain.com‘ ;