I have a domain for a project that will be closed soon and I want www.domain.com to redirect to another domain. Stil, while domain.com should be closed, we have to keep subdomain.domain.com up and running for a while. Since I kind of messed up with alias domain I’dd thought would be better to ask for directions as my logic says this might not even be possible.
I’m not sure what you’re asking. Is it an alias? What is subdomain.domain.com? Is it a sub-server, an alias, or a top-level server in Virtualmin? A subdomain is just a name, so it could be anything. subdomain.domain.com does not have to be owned by an account named domain.com.
Which also maybe answers your question. If it’s a sub-server with its own content, you could promote it to a top-level domain.
But, if you need to redirect the other domain to a new one, why would you disable domain.com? You need a website that serves the redirect, right?
i have mydomain.com and abcd.mydomain.com set as virtual server and sub-server respectively. I want to make mydomain.com alias of otherdomain.com, but stil have a working abcd.mydomain.com subserver. The reason is that after the end of the project, mydomain is no longer relevant, but still some of it’s traffic may be relevant for the otherdomain.com, while abcd.mydomain.com was actually a private use for the project members and accessible only via a VPN IP address, and needs to say until all activities were registered.
Promote abcd.mydomain.com to a top-level server. Delete the current mydomain.com and add an Alias named mydomain.com to otherdomain.com. Again, I don’t think I’m recommending this, but it could be done.
Rename mydomain.com to something else. Add an Alias named mydomain.com to otherdomain.com. This leaves everything as it is, but disappears the mydomain.com top-level domain so you can make an Alias elsewhere.
For your case, I believe I recommend the first one: just add a redirect to mydomain.com pointing to otherdomain.com. You’re done. Nothing else needs to change. Keep in mind that if you expect traffic to continue to mydomain.com you want to exclude .well-known paths from your redirect, so that it can continue to get Let’s Encrypt certs renewed. Having an expired or invalid cert on the domain that redirects will also lead to a browser security warning.