I'm not sure if this even is possible to do, but I have two different domains on two different webservers. Both have a SSL-certificate. What I need is for all links on domain1 (both http and https) to be redirected to domain2 with https. Example:
http://domain1.com/customlink should be redirected to https://domain2.com/customlink
Also https://domain1.com/customlink should be redirected to the same as above.
Is this possible to achieve by having a .htaccess file with some rules on the webserver of domain1.com? It is important that whatever the user writes after domain1.com, also will be kept in the new redirected link.