by Wen Hao Chuang.
I wonder other than comment out that redirect line, can I use DNS alias record to achieve similar result?
I mean if I have a fixed ip dedicated server which is hosting several Moodle sites (each one of them has their own domain names), and I want to avoid user seeing that "incorrect access detected" warning message and be able to smoothly go to the Front Page no mater whether they have typed in www.mydomain.com or just mydomain.com in the Web browser, can this be resolved by changing the DNS setting by creating a DNS Alias record? Thanks!