Maybe the title is a bit cryptical, but what I'd like to achieve is: when people end up with a link that ends on .com, it's permanently pointed / redirected to the .nl version. I thought it should be quite simple, but it tackled me completely.
Maybe I'm just overlooking something, so I could use some help from you guys / gals :-)
The first thing that I have to mention is that most of the traffic is pointed to a Lightspeed HQ e-Commerce server, where our webshop is running. Besides that, we have a small (inactive for the moment) blog, which should be accessible through a subdomain. The same for the e-mails and access to the webmail environment.
The main-domain is sceneryworkshop.nl The 'add-on' domain is sceneryworkshop.com - which should be forwarded to sceneryworkshop.nl.
Our hosting company is using Plesk, that I'm not quite familiar with. Certainly not the DNS-settings page. At first I was searching for a 301 solution, but couldn't find any of such thing. After that I tried tinkering with CNAMES, which didn't resolve many, because of conflicts with the 'Glue record for the domain'
Btw. pointing the .com to the same IP-Address gives more trouble with logging and a legit SSL certificate from Lightspeed HQ.
Anyone who could point me in the right direction based on my given info? Thank you very much in advance for thinking with me!
If you are able to get the full url in php, and split the url by a ".", and check if and only if "com" is the last string, by writing an if-else statement, and redirect the link if it is true
url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";