help with .htaccess for two domains

Discussion in 'Apache' started by Pinoguin, Jun 1, 2009.

  1. #1
    Hi,

    I have :
    domain.com and
    domain.at

    The .com site should point to the english site (lang=en) and the .at domain should point to the german site (lang=de)


    I managed to come up with:

    RewriteCond %{http_host}^domain.at [nc]
    RewriteRule ^(.*)$ http://www.domain.at/index.php?lang=de$1 [r=301,nc]

    It seems to work, default .com goes to english but what about .at's that has a www on it? when I type www.domain.at it goes directly to www.domain.com which is wrong...

    I have tried:
    RewriteCond %{http_host}^www.domain.at [nc]

    But that doesn't seem to work..


    Help please? thanks for reading. (this is a joomla site btw)
     
    Pinoguin, Jun 1, 2009 IP
  2. jnugroho73

    jnugroho73 Peon

    Messages:
    77
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this:

    
    RewriteCond %{HTTP_HOST} !^domain.com$
    RewriteCond %{HTTP_HOST} !^www.domain.com$
    RewriteRule ^(.*)$ http://www.domain.at/index.php?lang=de$1 [R=301,L]
    
    Code (markup):
    or this

    
    RewriteCond %{HTTP_HOST} ^(domain.at|www.domain.at)$
    RewriteRule ^(.*)$ http://www.domain.at/index.php?lang=de$1 [R=301,L]
    
    Code (markup):
    Good luck
     
    jnugroho73, Jun 4, 2009 IP