Accessing via IP while testing

Accessing via IP while testing

de Andre Basel -
Número de respuestas: 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

Promedio de valoraciones: -
En respuesta a Andre Basel

Re: Accessing via IP while testing

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

- Damyon
En respuesta a Andre Basel

Re: Accessing via IP while testing

de Michael Milette -
Imagen de Core developers Imagen de Documentation writers Imagen de Particularly helpful Moodlers Imagen de Plugin developers Imagen de Testers Imagen de 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

En respuesta a Andre Basel

Re: Accessing via IP while testing

de 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.