However, that obviously means that sub.domain.com shows all the root files (composer.json, web folder, config folder etc). I used these rules in my env file:
WP_ENV=‘development’
WP_HOME=‘https://sub.mydomain.com/web’
WP_SITEURL="${WP_HOME}/wp"
That let me get the site working if I view the web folder but not what I want. I want it to run so that you don’t see the root folder and from the front end perspective “web” folder is basically invisible. I hope that makes sense. I tried changing to:
WP_HOME=‘https://sub.mydomain.com/’
WP_SITEURL="${WP_HOME}/web/wp"
But that showed the site with missing stylesheets etc. I’m sure there is a htacess rule I could use but I’ve been searching and cannot find how this is possible.
You’d configure this outside of bedrock: Bedrock doesn’t know anything about server level routing, which is what you need to do here. Using whatever system you use to associate a domain with a web root, you need to associate a subdomain with the bedrock web root.