Send foriegn domains to specific url

Discussion in 'Apache' started by adzeds, Jul 31, 2010.

  1. #1
    Hi guys,

    We have got our domain name in several different countries TLDs, e.g.
    example.de
    example.fr
    example.es

    But our site is on a .co.uk.. What I want to do is check which domain the user came through and send them to a translated landing page..

    eg:
    .co.uk/store/f_landing?fl=de

    What is the most effective way of doing this?

    Guessing it may need a mod_alias or rules in .htaccess??

    Hope you can help
     
    adzeds, Jul 31, 2010 IP
  2. tolra

    tolra Active Member

    Messages:
    515
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    80
    #2
    If each has it's own web space then just forward each domain to the appropriate target.

    If they are all parked on top of the .co.uk then something like the following in .htaccess should do the trick:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www\.)?example\.(de|fr|es)
    RewriteRule (.*) http://www.example.co.uk/$1?fl=%2 [R=301,L]
    
    Code (markup):
     
    tolra, Jul 31, 2010 IP
  3. adzeds

    adzeds Well-Known Member

    Messages:
    1,209
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    100
    #3
    I am making changes to the .htaccess but it is having no effect.

    I think some other process must be getting there before it. Any ideas?
     
    adzeds, Aug 2, 2010 IP
  4. tolra

    tolra Active Member

    Messages:
    515
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    80
    #4
    Are your non-.co.uk domains parked on the .co.uk, that is if you go to example.de do you see the .co.uk?

    If yes that can you post your whole .htaccess or PM it to me if you don't want it public?
    If no then the above will not work, I'll have to give you different code for each domain
     
    tolra, Aug 2, 2010 IP
  5. adzeds

    adzeds Well-Known Member

    Messages:
    1,209
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    100
    #5
    if you go to example.de it redirects to example.co.uk..
     
    adzeds, Aug 2, 2010 IP
  6. tolra

    tolra Active Member

    Messages:
    515
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    80
    #6
    Well assuming it is parked then you need to remove the redirect to make the code I gave you work, would need to see your .htaccess for the .co.uk to be able to do much more.
     
    tolra, Aug 2, 2010 IP