Changing the URL of a moodle site?

Changing the URL of a moodle site?

by Ed Roseman -
Number of replies: 3
My web site host made my URL “mydomain.com/moodle,” which is okay for my trying to find my way around moodle initially, but I’d actually like it to be “mydomain.com/moreobviousname” for real world use. I’ve done some work on it in its initial location, and am wondering what’s the easiest way of changing the location. Backup & Restore? Something else? Or is is something my site host would take care of, just by changing the URL?

I'm using Moodle 1.9x.

Thanks ahead of time for any help!
Average of ratings: -
In reply to Ed Roseman

Re: Changing the URL of a moodle site?

by Garry Stokes -
Short answer - this is quite easy to do if you have access to normal web site management tools. eg if you are with someone who does linux hosting .. cpanel. OR your web site host may be willing to do that for free. If you let the forum know your host, peole could give you more specific instructions.

Long answer:

This should be as easy as changing the name of a folder, then changing the details in one text file.

You will probably find that your host has put your moodle files into a folder called moodle inside another folder, maybe public_html inside your home directory.

You need to rename the folder "moodle", to whatever you want, then edit the file config.php in that folder to reflect the change. eg change moodle to newname, then edit newname/config.php as follows

eg: for domain example.org, where the username of the admin is exampleo edit lines that read like this:

$CFG->wwwroot = 'http://www.example.org/moodle' ;
$CFG->dirroot = '/home/exampleo/public_html/moodle' ;
to:
$CFG->wwwroot = 'http://www.example.org/newname' ;
$CFG->dirroot = '/home/exampleo/public_html/newname' ;




In reply to Garry Stokes

Re: Changing the URL of a moodle site?

by Ed Roseman -
Hey Garry:

Isn't it lovely when the answer to a question is so simple, and the question is answered so completely and well! Thanks for your question answering generosity!

Edly
In reply to Ed Roseman

Re: Changing the URL of a moodle site?

by Gavin Henrick -
Picture of Plugin developers
Hi Ed,

Hopefully your migration will be straighforward, however, it is not always so simple depending on if you have any urls relating to content from the first site. (links to files/pictures etc..)

You are migrating from one URL, to another, so you should also look at the Moodle Docs -> http://docs.moodle.org/en/Moodle_migration which mentions in first scenario.

Also have a quick read of : http://moodle.org/mod/forum/discuss.php?d=57477

Hope this helps, if you run into not seeing files etc..

G.