Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Url re-direct?

  • 10-12-2002 9:44pm
    #1
    Registered Users, Registered Users 2 Posts: 1,695 ✭✭✭


    I want to re direct all Irish IPs to a diffrent homepage other than a default one...or can you redirect by geographical location?....is there an Irish IP list? or some easy way of doing this? running server on free bsd. thhks, D.


Comments

  • Closed Accounts Posts: 6,601 ✭✭✭Kali


    use a tiny piece of javascript/ssi on your main site to forward to the next one.
    clientip = "<-#echo var="REMOTE_HOST->";
    if(regexp(clientip) == "ie") {
    	window.location = "http://www.boards.ie/german";
    }
    

    where regexp is whatever regular expression it takes to take the last two letters of the clientip.. im not too familiar with its syntax in javascript :)


  • Registered Users, Registered Users 2 Posts: 7,521 ✭✭✭jmcc


    Originally posted by Kali
    where regexp is whatever regular expression it takes to take the last two letters of the clientip..

    Nice code but most Irish ISPs do not use .ie that much. Esat/Eircom tend to use .net. Sorting on IP would be possible but it would need the raw IP for the connection and a list of IPs. Doing the obvious ones would be easy but new IP ranges tend to get added by ISPs (eg Eircom added 213.94.13n for Wexford over the last week or so) all the time.

    There is also the possibility of a language check on the browser agent though that is probably even more iffy to implement. The simplest method would be to offer a language option button at the top of the page. (Cheap and nasty solution.)

    Regards...jmcc


  • Registered Users, Registered Users 2 Posts: 12,309 ✭✭✭✭Bard


    Ask them where they're from the first time they come to the site & set a cookie in their browser so that you'll know next time.

    Doing it by IP or domain is unreliable.

    [edit]: Then again... how does Google do it???


  • Registered Users, Registered Users 2 Posts: 7,521 ✭✭✭jmcc


    Originally posted by Bard

    Doing it by IP or domain is unreliable.
    Then again... how does Google do it???

    By IP. Though their 'pages from ireland' option is b0rked because they use largely the same idea as for user IPs. At least 50% of Irish websites are not hosted on Irish IPs.

    Regards...jmcc


  • Registered Users, Registered Users 2 Posts: 2,013 ✭✭✭lynchie


    We used a product before in an application that could return a country code for a particular ip address. The product was from this crowd. I think you are looking for something cheaper than this commerical program so try the folowing one istead - tis a lot cheaper GeoIP


  • Advertisement
Advertisement