Full domain rewrites

I'd like to have an alias domain (let's say alias.com) that redirects everything to main.com, meaning if a request goes to sub.alias.com/hello?world, then it gets rewritten and sent to sub.main.com/hello?world. Is there any way I can achieve this with a single rule of some kind? Thanks!
Was this page helpful?