I have to domains: mydomain.dk and mydomain.de. Both are showing the same page in danish. I have a plugin that takes care of the languages, but I need to connect the .de domain to the german ‘language layer’.
How can I redirect mydomain.de to mydomain.dk/?lang=de. The mydomain.dk must stay as it is.
Thanks in advance!
You could check the contents of the
$_SERVER['REQUEST_URI']
array when the site is loaded, by placing the conditional checking logic in your header.php file of your site and then redirect the user to the appropriate language from there.For example in header.php add:
The PHP manual page can also give you more information on the $_SERVER global array here: http://php.net/manual/en/reserved.variables.server.php
Hope this helps.