In MODX Cloud it is possible to have the main domain of your website of www.example.com be on one Cloud and a subdomain such as blog.example.com be on another Cloud.
Perhaps your organization's website is running MODX and you have a long-standing WordPress blog you'd like to host in MODX Cloud in a Flex Cloud. There are other scenarios as well such as analytics applications such as Piwik or running your staging site at staging.mysite.com.
This article assumes you have already added your custom domain on another Cloud.
Part 1: Inside MODX Cloud Dashboard
Part 1, gets everything set up for your subdomain in MODX Cloud. Part 2, below, makes the changes at your domain management or domain registration service.
-
From your list of Clouds on the Clouds page, double click on the name of the Cloud you wish to be the subdomain of your main site.
-
Click on the Domains tab.
-
Click the checkbox at the right of that section that says Show all available domains.
-
You should now see a list of all the available custom domains you have added to your MODX Cloud account.
-
Click on the name of the account you wish to add the subdomain to.
-
Click the Create Subdomain button.
-
In the dialogue box that appears, enter the name of the subdomain you are adding: e.g., blog.
-
Click Create Subdomain to complete the process.
-
Click on the Summary/General Information tab and locate and copy the IP address of this Cloud for Part 2, below.
Part 2: At your DNS Management or Registrar
-
Login to your Domain Management Service, Registrar or wherever you manage your DNS for your domains.
-
Using the IP Address you copied in Step 9, above, update the IP address for an existing A record for the domain or create a new A Record for the domain.
-
Depending on the time-to-live and the DNS service it will usually take 15 minutes to 2 hours (and even as long as 48 hours) for the subdomain to propagate the internet. To check on the progress, you can use WhatIsMyDNS to monitor the progress. When the A Record shown matches the IP address, you'll know it's working.
Make the Subomain the Default Address for the Cloud
You can optionally change the default address for the Cloud so that when you click View Site or View Manager inside MODX Cloud it uses the subdomain address rather than the Cloud Address of c000x.xxx.paasx.modxcloud.com.
-
From the Summary/General Information tab of the Cloud Edit view locate the View Site URL dropdown.
-
Click the arrow at the right of the dropdown to activate and locate the subdomain name from the list. It should be at the bottom. If the newly added subdomain is not there, refresh your browser and then try again.