I want to open different pages by default in different countries. But It affects SEO of main URL. 

Like my website is `example.com`. I want to open this URL in India and `example.com/abc` outside India by default. 

But my SEO of `example.com` should not be affected. how can I achieve that? I have written following script for this on top of index page.

```
<script>
    $.ajax({
        url: 'https://ipapi.co/json/',
        dataType: 'json',
        async: false,
        success: function(data) {
        if(data.country_name.toUpperCase() != "INDIA")
             window.location.href = "/abc";
        }
    });
</script>

```

It is navigating fine, but it is deindexing `example.com` from google