Htaccess, can I redirect users from a specific country?

Discussion in 'Site & Server Administration' started by Aarashh, Aug 22, 2010.

  1. #1
    Hi,

    I'm not good with codings at all and stuff:)
    I have a current website which is getting a decent amount of traffic, but the website is only good for a specific country so I wonder, can I use htaccess or another method to redirect the other users from other specific countries to another site more suitable for them? :)

    I would really appreciate it if someone could help me with this one.

    Regards
     
    Aarashh, Aug 22, 2010 IP
  2. mellow-h

    mellow-h Peon

    Messages:
    750
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes, you can. The best and easiest way to do this is to use mod_geoip: http://www.maxmind.com/app/mod_geoip

    This database isn't built in with default apache. So, you have to add this module with your apache first before being able to use it.
     
    mellow-h, Aug 22, 2010 IP
  3. Aarashh

    Aarashh Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for your answer, I just talked to my hostgator support and cause I'm on a shared host, this is not possible and I would need to change to dedicated.

    So is there any other way, the support told me I could do this thow the htaccess file but I don't have a clue on how to do this cause I'm not good at coding:)

    Regards
     
    Aarashh, Aug 23, 2010 IP
  4. Aarashh

    Aarashh Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Just got help from one dude so thanks anyway :)
    Got my problem fixed :)
    Just added some lines to htacces :)

    Regards
     
    Aarashh, Aug 23, 2010 IP
  5. romika

    romika Member

    Messages:
    264
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #5
    romika, Aug 24, 2010 IP