Hey Stefano,
I’m back in business
I’ve managed to sort out the issue for the ‘eu’ site, like this:
- Enable single_language_url_prefix module on the eu site, so it applies a ‘eu’ prefix to the base ur.
- Pantheon ‘eu’ site to be provisioned by default on cherrythinkingdev.com on Route53, so basically cherrythinkingdev.com serves cherrythinkingdev.com/eu and the right site.
- However achieve the same with cherrythinkingdev.com/us is a different story, since cherrythinkingdev.com is provisioned with the Pantheon eu site, so even if I create a subdomain on Route53 for the US site, and provision it with cherrythinkingdev.com, it still serves cherrythinkingdev.com/eu.
So I tried the approach you mentioned on Domain mask for subfolders and different sites - #6 by StefanoWP to amend the base url on the settings.php of our site:
if (isset($_ENV['PANTHEON_ENVIRONMENT']) && ($_SERVER['HTTP_HOST'] == 'us.cherrythinkingdev.com') && (php_sapi_name() != "cli")) {
$newurl = 'https://www.cherrythinkingdev.com/us'. $_SERVER['REQUEST_URI'];
header('HTTP/1.0 301 Moved Permanently');
header("Location: $newurl");
exit();
}
Unfortunately this didn’t work either since when, the new url (cherrythinkingdev.com/us) is not found, I think due to cherrythinkingdev.com being provisioned with the Pantheon eu site.
So I’m trying to make it work with Cloudflare’s features, as follows (please correct me if you think any step can be wrong):
- Finish the nameserver setup of my test domain (cherrythinkingdev.com) by removing the Pantheon nameservers from Route53 and replace them with Cloudflare ones (it says it can take up to 24h).
- Once this process is completed and cherrythinkingdev.com is provisioned by Cloudflare, try to create two subfolders on Cloudflare (Workers?).
- If the above is possible, then point each subfolder to the respective site on Pantheon (eu/us).
- Job is done?!?
So, whilst I wait for the provision of the domain with Cloudflare nameservers I need to work out how to solve points 2 and 3 above.
Many Thanks for help @StefanoWP
UPDATE
I’ve completed step two, so now Cloudflare is taking care of of cherrythinkingdev.com
Now, trying to connect Pantheon DNSs on Cloudflare, the thing is, I can see I’ll have the same problem I was having with Route53, this is, I can only assign DNSs from one site (either EU or US on Pantheon) to cherrythinkingdev.com right? If so, how then will I be able to serve each respective Pantheon site with cherrythinkingdev.com/eu and cherrythinkingdev.com/us?