Do we have the possibility to access the application using both IP and domain name

Do we have the possibility to access the application using both IP and domain name

by SIERRA TEC -
Number of replies: 2
Hi,

We have set the Moodle application url in config file as follows and this is working as expected
www.hr.domain.com/recruitment

If we set the application url with IP as xxx.xxx.x.xxx:8082/recruitment in config file this is also working

Do we have the possibility to access the application using both IP and domain name

Please suggest

Thanks
Average of ratings: -
In reply to SIERRA TEC

Re: Do we have the possibility to access the application using both IP and domain name

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

It's possible but you shouldn't because it's not supported and causes problems.

The docs say that $CFG->wwwroot "must be a fixed URL (a string constant) that points to your site".

To do what you're asking some people have set $CFG->wwwroot programmatically (see this thread and this reply). The Moodle docs say explicitly that you must not do this:

Do not try to set this with any PHP code that can generate a variable URL. This is not supported, can cause strange problems and will stop command line scripts working completely.

Average of ratings: Useful (1)
In reply to SIERRA TEC

Re: Do we have the possibility to access the application using both IP and domain name

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It might be helpful if you can explain what problem you are trying to solve by having a moodle site accessible in this way. It might be possible for someone to suggest an alternative solution.