Hi guys,
Could anyone help me with my problem?
We have published our Moodle site to the external Internet using Azure AD Application Proxy. Alongside this we have changed Moodle site address (say, from "https://oldsite.com" to "https://newsite.com") and set up DNS servers to resolve new name into external and internal addresses for Internet and Intranet visitors respectively (this works correctly). It had been done by our colleagues since I don't have an access to those services.
What have I done with Moodle:
1. Changed $CFG->wwwroot in config.php
2. Run search and replace on "admin/tool/replace/index.php" page to change old address to a new one
3. Purged all caches
4. Installed new certificates for "*.newsite.com"
What have we got:
When I try to access the page from the external Internet, I receive such an activity:
Request URL: https://newsite.com
Remote Address: <External address>
Status Code: 301 Moved Permanently Location: https://newsite.com/
Request URL: https://newsite.com/
Status Code: 303 See other Location: https://newsite.com
Request URL: https://newsite.com
Status Code: 301 Moved Permanently Location: https://newsite.com/
Request URL: https://newsite.com/
Status Code: 303 See other
Location: https://newsite.com
Request URL: https://newsite.com
Remote Address: <Internal address>
Status Code: 301 Moved Permanently
Location: https://newsite.com/
Request URL: https://newsite.com/
Status Code: 200 OK ... And then everything goes right.
P.P.S. If I change $CFG->wwwroot in config.php back to old value and try to access website from external Internet, I get the following:
Request URL: https://newsite.com
Remote Address: <External address>
Status Code: 301 Moved Permanently Location: https://newsite.com/
Location: https://newsite.com/...but of course, all links on this page lead to old-style addresses "https://oldsite.com/..."
Request URL: https://newsite.com/
Status Code: 303 See other Location: https://newsite.com/index.php Request URL: https://newsite.com/index.php Status Code: 200 OK ... And then everything goes right.