I have about 10 domains, al going to the same website (a .com), http and https.
Now on my website I want to check via htaccess if the entered domain is .com or not, and if not redirect to the .com. How can I do this?
Example: vistor types in http://www.mywebsite.org
-> redirect to http://www.mywebsite.com
Example 2: vistor types in https://www.mywebsite.eu
-> redirect to https://www.mywebsite.com
Try adding this in the .htaccess file in your document root:
You can add the other TLD’s in the
(org|eu)bit, separated by a |