When working with our site, lets call it "www.toplevelarcdomain.com", we have a situation where we are required to solve the following:
www.toplevelarcdomain.com is the toplevel domain
Then we have local sites:
www.toplevelarcdomain.com/westcoastbrand/
www.toplevelarcdomain.com/greatoldcitybrand/
www.toplevelarcdomain.com/anotherlocalbrand/
www.toplevelarcdomain.com/yetanotherlocalbrand/
www.toplevelarcdomain.com/futuretownbrand/
More local sites could be added in the future
Local articles will be organised below these sections. Each site will have local logos, navigation, curation, and local related content, paywall, checkout, login, stats, etc.
We have been discussing the possibility to have local domains or subdomains for each of these local sites.
This would be a good fit for working with content within Arc in a standard way, as well as utilizing standard Pagebuilder/themes blocks features and behavior.
Also, we want to circulate articles to have the user stay in their local context with local links in the different subsites, avoiding the need to clone stories into local sites.
However, there is a business requirement that all content MUST be organized below www.toplevelarcdomain.com.
This has been a headache for a while, but we have been thinking of a possible solution.
We have made a design that we think can accomplish what is wanted , but it depends on Arc being able to do some logic at the origin/CDN to set the context in a bit custom manner:
So, what we will do is this.
The base url (in composer, blocks) for all subsites will be "www.toplevelarcdomain.com"
Each “section” would correspond to a site in site service:
westcoastbrand
greatoldcitybrand
anotherlocalbrand
yetanotherlocalbrand
futuretownbrand
All articles on the local site will get a url format that places the article under the subsite section. So the default format for westcoastbrand will be:
/westcoastbrand%websites.westcoastbrand.website_section._id%/%publish_date|year()%/%publish_date|month()%/%publish_date|day()%/%headlines.basic|slugify()%/
At the origin, where the "_website=dagavisen" will be normally will added based - based on the domain - A new rule must be introduced by Arc. The name of the first section should be matched to a list of possible options. And if there is a match, that value should be used as the website parameter: Example regex for article matching: https://regex101.com/r/ikNZwz/2/
(/(westcoastbrand|greatoldcitybrand|anotherlocalbrand|yetanotherlocalbrand|futuretownbrand)/./[0-9]{4}/[0-9]{2}/[0-9]{2}/.)
So, an url :
https://www.toplevelarcdomain.com/westcoastbrand/news/2021/01/16/Yes-this-is-a-great-story
should result in a fusion origin request like this, because "westcoastbrand" is the first section:
/pf/westcoastbrand/news/2021/01/16/Yes-this-is-a-great-story/?_website=westcoastbrand
In this case
the app context in react will be set to "westcoastbrand", picking the correct config from blocks.json
The content api (/content/v4/) query will use the given context and query the "westcoastbrand" website for the content, and provide the relevant circulated version of the url.
SO, this would involve the ability to have a bit more custom rules when setting the website context then a hard mapping to a site.
Would you be able to add a rule like this on the cdn or origin, or wherever the _website=westcoastbrand is set?