Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.
At any rate, we now have our new WordPress site at my.auntminnie.com and we need to get my.auntminnieeurope.com to share the SAME database (users and other data) and just show a slightly different look (stylesheets, etc) based on the URL.
Hey @Owen37 , Local can’t do what you’re describing out of the box. I think the only way you can get something like this to sort of work is roughly like this:
Create a new, plain, Sub-domain multisite (this will create the necessary settings in Local to allow multiple subdomains to reach a specific Local site)
Edit the wp-config.php file for that site and comment out the multisite settings
Manually add the subdomains you want to your hosts file. Note that you’ll need the domains to be subdomains and not two different top-level domains. So dev1.example.local and dev2.example.local would work, but example.local and myexample.local wouldn’t.
Do your site-specific code within the WP site
I haven’t done this, so I don’t know how fragile this is or if the changes get wiped out during updates.
If that doesn’t work, then your other option would probably be to use Local in “localhost” router mode, and then manually spin up your own proxy server to resolve the domains to the individual sites.
But why can’t I just edit…
I don’t think you will be able to edit Local’s default server to get what you need.
There are at least two “web servers” in play (see this help doc: What is Router Mode? for more details), to summarize:
Each WP site has one web server (nginx/apache), which listens on an open port (like localhost:10010)
The Local router proxies the site’s domain to the individual site’s web server
For what you’re describing, you would need to edit the Local Router’s configuration. That config is found within the user configuration folder, within the run/router sub-folder. Here’s where that is on my Mac. For you on windows, it will be similar, but located in your User folder, under AppData > Roaming > Local
The problem is that there isn’t a way for you to update that file and have it re-loaded into the running Nginx process. Every time Local starts a site, it compiles these configuration files and reloads the nginx process using the values that are set in the Local UI. There isn’t a way to set multiple domains for a regular site within the Local UI.
The reason that creating a multisite within Local might work, is that the nginx config that it uses listens for a wildcard subdomain.
I know this is a rambling reply, but hopefully it gets you something you can use. Let us know if you have any other questions!
Thank you for the detailed reply. Due to the complexity (and probably unstable) of the solutions, we’re probably going to find another way to specify which “branding” should appear on the site as a user navigates through it with just the one domain.