Multi Domain Setup for Redirect Purpose

Hi guys,

brainstorming time: is there a way to redirect domains (which I own) inside MODX without having to create a separate context for each?

Let’s say my company website domain is: apple.com
I am working in the web context, building my site, adding folders, subfolders, resources, etc… until it’s finished.

One possible URL could then be: apple.com/iphone/iphone-11/reseller

BUT this URL is too ugly, I want it shorter (for marketing purposes). Therefore I own another domain, for example: iphone.com

Now I would like to redirect iphone.com/buy to apple.com/iphone/iphone-se/reseller but I don’t want to setup a website for iphone.com NOR do I want to fiddle around in the .htaccess file.

How can I redirect the iphone.com Domain (and nonexistent subpaths) inside MODX?
Do I need to setup a context for iphone.com?
What if I had 20 of those additional Domains? One context for each?

I know about the Redirector plugin… but would it work in this case?

I think, the easiest and cleaniest way really would be to create a context for each domain.
Not sure, if it would be possible to have different domains pointing to one context in that way, at all.
In any case, it would be complicated.

You could create a routing plugin like CustomRequest, that runs onPageNotFound and check $SERVER[‘http_host’] inside of that code too.

I see. Thank you for your replies!
Brainstorming further and considering to dive into CustomRequest, did not know about that.