Hello all! I have a seemingly simple need, but I’m not sure the best way to implement it.
For some time, I used a domain for some of my services, let’s call it olddomain . com. I have since moved all the services to the new domain, called newdomain . com. Services are accessed via a unique subdomain, such as app1 . olddomain . com.
The need is simple, to allow users to use the old domain name, but redirect to the new domain. But I want to do this while preserving the subdomain the user typed in.
By way of example, if a user goes to app1 . olddomain . com, I’d like the browser to get redirected to app1 . newdomain . com. I think rewrite is the best way to implement this, but I’ve never gotten this deep into the caddyfile syntax. Can anyone help me out?