fetch('https://api.country.is/')
    .then(function(response) {
        return response.json();
    })
    .then(function(data) {
        switch (data.country) {
            case 'TR':
                window.location.replace("http://tr.com");
                break;
            case 'US':
                window.location.replace("http://en.com");
                break;
            default:
                window.location.replace("http://standart.com");

        }
    });