1

How would I solve the next situation with the .htaccess file?

I have 3 domains:

 - www.domain.be
 - www.domain.uk
 - www.domain.io

if someone visits the website trough www.domain.be it has to be redirected to

www.domain.be/**?language=dutch

the other two domains has to be redirected in the same fashion:

www.domain.uk/?language=english_UK* and *www.domain.io/?language=english_US

And is there an solution for sending users to a certain domain trough gelocation? For example: An American user visits www.domain.be, this domain is used for belgian users, can I redirect them to domain.io and visa versa?

Odyssee
  • 2,393
  • 2
  • 19
  • 38
  • Possible duplicate of [Redirect From one page to another page using htaccess](http://stackoverflow.com/questions/24682594/redirect-from-one-page-to-another-page-using-htaccess) – Muhammad Muazzam Dec 30 '15 at 09:39
  • you want to do with .htaccess or php? – Amit Rajput Dec 30 '15 at 09:52
  • 1
    If every visitor of .be gets language=dutch and every visitor of .uk gets language=english_uk why do you need those values at all? Just implement languages statically per domain. – maxhb Dec 30 '15 at 09:53
  • I won't use geolocation for redirecting users. Simply use the preferred browser language as described here: http://stackoverflow.com/questions/3770513/detect-browser-language-in-php – maxhb Dec 30 '15 at 09:55
  • The website is build around whmcs, the domains all point to the same web root. The different languages are currently handled with php and the user can choose his language. But when a user visits one of the domains he gets to see the default language. To solve this I can use geolocation or the browser language for the language and currencies. But that does not affect domain. But I think I have found a workaround. I will post the answer if it works. – Odyssee Dec 30 '15 at 09:59

0 Answers0