Set URL Address

Set URL Address

by solmaz naderi -
Number of replies: 2

Hi every one

I'm using xampp on winserver 2008 and I have a public IP and set a name for that by DNS

now I acceess my moodle by this URL:"http://My Domain/server/moodle/

But I want access by this URL:"http://My Domain

so, would you help me how can I eliminate "/server/moodle/"  in end of URL addreess?


the fallowing text are part of Config.php:

$CFG->wwwroot   = 'http://mydomain/server/moodle';

$CFG->dataroot  = 'C:\\xampp\htdocs\server\moodledata';

$CFG->admin     = 'admin';


Regards

Solmaz

Average of ratings: -
In reply to solmaz naderi

Re: Set URL Address

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

You need to set this in your Apache config - add /server/moodle to the end of your default website address.

Then, go to config.php and update the address there removing the /server/moodle.

Then, run the replace.php (admin/tool/replace.php) to update your database.

In reply to solmaz naderi

Re: Set URL Address

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Solmaz

If you are never going to use your instance of xampp for anything else, you could alternatively just move your website to the root of your site:

  1. Move the moodledata folder itself into to \xampp\htdocs\
  2. Move all the files and folders inside \server\moodle\ into \server\
  3. Edit your config.php file to reflect the new location of your moodle wwwroot  to http://mydomain/ and moodledata dataroot to c:\\xampp\htdocs\moodledata
  4. Finally, run the search and replace script to update anything in your database that might pointing to the old location of your site. So search for mydomain/moodle/server and replace it with just mydomain. You should do this step anytime you move your site regardless of whether you implement my suggestion here or Emma's.

For more information on using the Moodle Search and Replace tool, visit https://docs.moodle.org/27/en/Search_and_replace_tool

Best regards,

     Michael Milette