We recently received a request to move an externally hosted site into our local Reason instance. The challenge is that the domain name is supposed to remain outside of the carleton.edu realm. Reason has never supported this natively, though it could be achieved with unpleasant hacks. With Reason 4 Beta 8, this will all change and subdomains and external domains will be fully supported.
Bonus benefit of this work: the reason_package folder will no longer have to be within the web tree.
The code changes to achieve multi-domain support cross many areas of Reason, from the "bootstrap" process and login site setup, to Reason's fancy 404 handler which helps make sure page links never break. We are launching the multi-domain support as an "experimental" feature in Reason 4 Beta 8, but we will be using it locally at Carleton soon.
A few tidbits on how it will work:
There will be a new settings file called domain_settings.php in the settings folder. This file will contain an empty array that allows you to setup domain specific settings. When Reason is defining various constants during the bootstrap process, it will be able to pay attention to these domain specific settings. While technically, any settings can be setup to be domain specific, we'll only officially support a small set of domain specific settings.
If the domain_settings.php file has been configured, the "Site" content manager in the Master Admin site will show an additional domain field for each site. The domain will be able to be changed at any time to any domain that is configured in domain_settings.php.
Each domain will have its own space in the file system and .htaccess rewrites. Accordingly, there will be a login site created by the reason setup script for each domain configured in domain_settings.php. Each domain will technically have its own www folder, but the contents within the www folder (such as "images", "js", "css") should be at consistent locations relative to the domain root, and in most cases should be setup as aliases to a single location for these resources. This approach helps ensure that relative links continue to function even when resources move between domains.
The reason installation documentation will be updated to recommend that the reason_package be installed outside the web tree. This will mean that links to images will no longer need to have odd URLs like /reason_package/reason_4.0/www/images/1.jpg, but can instead be at /images/1.jpg. Reason 4 Beta 8 will continue to support installations inside the web tree, so existing installs will continue to work.
These changes should greatly improve the maintainability of Reason installs within shared hosting environments, and allow management / upgrade of Reason sites at many domains from a single interface.