Redirecting the domain with the cpanel

Redirecting the domain with the cpanel

by Lionel A. Richemond -
Number of replies: 3

Hi! Please excuse my english. 
I'm using Moodle 3.5.1+ (Build: 20180810) with Fordson v3.5.

I'm trying to redirect my site to a new url. 

Let's say my site is accesed via: puripuri.com/campus/site
and the cpanel folder is: public_html/campus/site
and I want it to be redirected to my new domainmyawesomemoodlesite.com

modify addon domain

modify subdomain

I'm trying to use the same formula that I used with the other domains, with no effort.
Am I lacking some configuration in the htaccess? I have rewrite engine set to ON.

Thank you for your help.

Lionel







Average of ratings: -
In reply to Lionel A. Richemond

Re: Redirecting the domain with the cpanel

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

What is your $CFG->wwwroot setting in your Moodle's config.php

The big problem is that you can only have one setting. So, you can't redirect in the sense that both before and after URLS will work.

Average of ratings: Useful (1)
In reply to Howard Miller

Re: Redirecting the domain with the cpanel

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

To follow up on what Howard has said, I think that you have two lines in config,php to worry about.

$CFG->wwwroot   = 'https://www.rjerz.com/moodle';

The above line for you should be 'https://myawesomemoodlesite.com"

$CFG->dataroot  = '/home/your_user/moodledata3';

This line should probably stay at where it is.

In my lines, you will still need to adjust these for your particular server and moodle installation.  Don't take my lines literally.  For example, I have named my moodledata folder moodledata3.  Yours might be different.

Had your moodle been working before you tried moving it to a subdomain?

Average of ratings: Useful (1)
In reply to Rick Jerz

Re: Redirecting the domain with the cpanel

by Lionel A. Richemond -
I would like to thank you both Howard and Rick !!!

I could make the redirection.
I used your advices and plus I had to modify the routes to the files and the fonts

Thank you so much !!

Mission accomplished