Hi
I have a website with two domain names. The first, example.com, serves as the site's main domain, the one under which I originally installed Moodle. Then I set another domain, that is, example.org, simply as another way of accessing the website. Now, my problem is: since I have installed Moodle under example.com/moodle, if somebody change the .com in the address to .org, the website gives the following message:
"Incorrect access detected, this server may be accessed only through "http://example.com/moodle" address, sorry.
Please notify server administrator.
And then after a few seconds redirects to the correct address.
What I want to achieve is a method of redirecting any such incorrect accesses to the site's main address, that is, example.com.
Any ideas would be appreciated. Thanks
PS: I've read similar posts saying such cases can be done with the help of .htaccess. But I am not very good at that. Please let me know what lines I should add to .htaccess file if that is the right solution at all.
I have a website with two domain names. The first, example.com, serves as the site's main domain, the one under which I originally installed Moodle. Then I set another domain, that is, example.org, simply as another way of accessing the website. Now, my problem is: since I have installed Moodle under example.com/moodle, if somebody change the .com in the address to .org, the website gives the following message:
"Incorrect access detected, this server may be accessed only through "http://example.com/moodle" address, sorry.
Please notify server administrator.
And then after a few seconds redirects to the correct address.
What I want to achieve is a method of redirecting any such incorrect accesses to the site's main address, that is, example.com.
Any ideas would be appreciated. Thanks
PS: I've read similar posts saying such cases can be done with the help of .htaccess. But I am not very good at that. Please let me know what lines I should add to .htaccess file if that is the right solution at all.