Dang, not two weeks ago was I looking at something similar!
In short, it is possible (to redirect to your main domain) but you’re gonna need a redirect, either in the .toml or a _redirects file. The beauty of keeping these out in a file is, with a bit of jiggery-pokery, you can make them context-based. You want certain redirects for prod versus dev? Great! Deploy previews need handling differently? Sorted!
Your rules themselves don’t have to be hard-coded. They can be pretty flexible and we allow for things such as splats and query parameters. But, I think you mean ‘hard-coded’ in relation to the fact that they’re in a file… that said, they’d be hard-coded in the UI, no?