Moving moodle from directory to root

Moving moodle from directory to root

by Nikola Novakovic -
Number of replies: 1

Hello there,

I'm new to Moodle software and I need a bit of help and advice about how to proceed.

I installed moodle in subdirectory on my server, so it's currently accessed through mysite.com/~directory/

It all works fine, but I'd like to move it to root directory, as I have nothing there, and I don't want that directory name to be seen when accessing moodle itself.


What exactly should I move to root, and where to change paths/settings? Should I also change something in the database?

Moodle version: 3.6.2+

Thanks in advance.


Average of ratings: -
In reply to Nikola Novakovic

Re: Moving moodle from directory to root

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

This happens outside of Moodle. In your web hosting interface you must set http://mysite.com to point to the ~/directory (where the config.php file is). This may be called web root, DocRoot or something similar.

With that you need to match $CFG->wwwroot = ' http://mysite.com'; in your config.php.

You need to clean up the URL in the Moodle database through https://mysite.com/admin/tool/replace/.