I really appreciate such a though response.
Please let me give you some more insight about the issue I’m trying to solve.
There are several ways to achieve that, and you will do that within your server set up .
Unfortunately Pantheon won’t allow me to make any modifications on nginx.conf
Pantheon does not support managing redirects in
.htaccess files, since they are ignored by NGINX for reduced resource consumption and increased efficiency. This configuration is standard across all Pantheon sites, and modifications to the
nginx.conf file are not supported.
That was actually the very first approach I tried to take but didn’t work because of not getting access to the nginx configuration.
In that case, you can use your main domain for the main language and redirect users to the other site with a simple button on the header that will tell the users “US site or anything else” and get them to the sub-folder-ed site.
That’s actually the current behaviour so hopefully I can manage to reproduce it on the new setup with Pantheon.
create a sub domain within your Domain provider, add this sub-domain to CloudFlare DNS, and redirect users choice. (for and example you could create a pop up and ask the user where they prefer to continue on the US site or another).
We have a pop up too so users can land into the default site (EU) and confirm wether they want to continue towards EU site or instead, visit the US version.
I think the key thing here is, even although I can create a subdomain on the AWS side, it will only allow me to create something like us.mydomain.com (subdomain) whereas, what I actually need is mydomain.com/us (subfolder).
On the previous architecture, creating the subfolder was straightforward with symlinks, since the setup was a multisite, this is, both sites on the same root folder like:
[us] -> siteus (symlink to us site)
[eu] -> / (symlink to default)
With the new set up at Pantheon, the two sites are now totally independent. They have their own root so won’t be able to add symlinks anymore in order to create the actual subfolders /eu and /us
So basically the hassle here is how to manage to get those subfolders (hopefully generated with Cloudflare) so my new architecture maintains the current behaviour, this is:
mysiteDOTcom (by default to PantheonSiteEU site)
mysiteDOTcom/EU (serves PantheonSiteEU site)
mysiteDOTcom/US (serves PantheonSiteUS site)
Is there anyway to achieve this i.e. creating a subdomain like:
us.mydomain.com and convert this into mydomain.com/us, and at the same time, this serves PantheonSiteUS site?
I hope this gives more clarification one the actual issue.
Thank you very much once again @StefanoWP
I managed to create a subdomain on Route53 like eu.mywebsite.com CNAMEd to mywebsite.com/eu
The idea is now point that CNAME mywebsite.com/eu to [https://dev-mysite1.pantheonsite.io](https://dev-mysite1.pantheonsite.io/