I'd like to implement a website with multiple, slightly different versions of the whole site available under a single domain. The separate versions of the site should be accessible under different URL paths:
- http://www.example.com/ (main version)
- http://www.example.com/foo (customized for Foo)
- http://www.example.com/bar (customized for Bar)
If the different versions could be hosted on separate (sub)domains, the Domain Access module would work mostly out-of-the-box for me. But I really want to host everything under a single domain. The Subfolders Domain module adds support for subdirectories to Domain Access, but it only works with Drupal 7 and seems discontinued. There were a few requests to add similar functionality directly to Domain Access, but the maintainers don't seem interested.
So how could this be implemented with Drupal 8? I would also consider solutions that don't rely on Domain Access and/or require a bit of custom code. For the most part, I simply need to create a copy of the website under a subdirectory with
- some adjustments to content and presentation that I can easily perform in templates or hooks depending on the requested URL.
- some pages only shown on some versions, with a UI similar to Domain Access.