Developer forum

Forum » CMS - Standard features » Geo IP redirection

Geo IP redirection

Adrian Ursu
Reply

Hi Guys,

I have a project with several country verisions websites and the client wants to have an default automatic redirect to the correct country based on the IP of the visitor.

Is this something already built in Dynamicweb or should we build something special for this?

Anyone has done this before?

Thanks,


Adrian

 


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

It is not build in.

The statistics API have something you can use.

Make a reference to Dynamicweb.Compatibility.dll and do like this:

Dim l As New Dynamicweb.StatisticsV3.CountryLookup

l.getCountry("10.0.0.1").getCode = "DK"

BR Nicolai

 
Nuno Aguiar
Reply

HI Adrian,

 

We have developed a module in Portugal to achieve this:

  • It is based in IP ranges for each country (SQL table updated though an CSV)
  • You select which country redirect to which page

 

If you are interested in this, let me know.

 

Nuno

 
Adrian Ursu
Reply

Thank you Nicolai, Nuno

We'll try Nicolai's suggestion first. If it doesn't work, I'll take advantage of your offer.

Thanks,

 

Adrian

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

@Nicolai, on a Dynamicweb 9 - how could this be achieved?

 
Nicolai Pedersen
Reply

Hi Hans

You will have to do this custom - using i.e. Maxminds free data and API: https://dev.maxmind.com/geoip/geoip2/geolite2/

I am pretty sure there are also hosted javascript versions of this you can use.

BR Nicolai

 

You must be logged in to post in the forum