Redirect of one subdomain to another

I can't seem to find a simple answer to this question as all redirect/rewrite examples are always trying to do so much more than what I want to do:

I have a server block where server\_name is a wildcard:

server\_name \*.example.com;

All I want to do is redirect [sub1.example.com](https://sub1.example.com) to [sub2.example.com](https://sub2.example.com).

How would I write this redirect/rewrite?

1 thought on “Redirect of one subdomain to another”

Leave a Comment