Accessing via IP while testing

Accessing via IP while testing

by Andre Basel -
Number of replies: 4

I am busy trying a new install of Moodle. Once I am happy with it we are going to use it as our main install (no we don't want to migrate or upgrade the old site).

While doing this I would like to access it via the IP. Am I able to temporarily disable 


"Incorrect access detected, this server may be accessed only through "http://moodle.mysite.school.nz" address, sorry.

Please notify server administrator."

Thanks

Average of ratings: -
In reply to Andre Basel

Re: Accessing via IP while testing

by Damyon Wiese -
If you change your $CFG->wwwroot in config.php to http://IPADDRESSGOESHERE then it won't do this redirect.

- Damyon
In reply to Andre Basel

Re: Accessing via IP while testing

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

When you change your URL to or from the IP address, be sure to use the search and replace tool on your Moodle site. Otherwise, if you've been developing with http://127.0.0.1/moodle and then change the website address to http://yoursite.com/moodle, there might be links in the database that still point to http://127.0.0.1/moodle which would not be good.

Best regards,

     Michael

In reply to Andre Basel

Re: Accessing via IP while testing

by ryan sanders -

in the config.php try changing $CFG-> wwwroot to something like below

$CFG->wwwroot   = 'http://' . $_SERVER['HTTP_HOST'] . '/moodle';

the $_SERVER['HTTP_HOST'] should let you access moodle from multi domain names to IP addresses. 

WARNING certain things save actual IP address or yoursite.com into the database. and you may need to do a "migration" thing on the database.   see http://docs.moole.org  and search for "migration" for more information.