I have a bunch of domain names with different TLDs. What I want is to point several domains to the "main"-domain which has a SSL cert (single domain).
https://maindomain.com (main domain with SSL cert) http://additionaldomain1.net (should redirect to https://maincomain.com and rewrite the URLs) http://additionaldomain2.org (should redirect to https://maincomain.com and rewrite the URLs)
The https domain points to the directory which contains the website data. I created a subfolder in that directory where I pointed the additional domains to, because I was thinking I could place a htaccess file there to manage redirection and rewriting. Is that OK so far?
I am having trouble finding the correct htaccess rules which permanently redirect the requested domain (either
https://maindomain.com and rewrites the URLs correctly.
I tried the simplest thing that came to my mind:
Redirect permanent / https://maindomain.com/
But that resulted in e.g.
https://additionaldomain1.net which, of course, does not work.
I use WordPress and put
https://maindomain.com as blog URL as well as site URL in the settings and I made WordPress force SSL.
Can someone please help?