Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Colin 46 posts 146 karma points
    Feb 24, 2020 @ 14:17
    Colin
    0

    How to redirect by country

    Hi

    2 sites under Umbraco, Uk and Germany. I have added the relevant URLs under cultures.

    If a user is in Germany how could I have them automatically redirect to the German site?

    Thank you

  • Garðar Þorsteinsson 113 posts 534 karma points
    Feb 24, 2020 @ 15:01
    Garðar Þorsteinsson
    0

    Hi Colin,

    You would use a service for example like Maxmind GeoIp to find out from what country the ip address is from.

    https://www.maxmind.com/en/geoip2-country-database

    You would look this up on the first request to the site and redirect from there.

  • Adam Werner 21 posts 202 karma points MVP c-trib
    Feb 24, 2020 @ 15:47
    Adam Werner
    0

    Employing a geolocation service can prove very helpful.

    An alternative to this could be querying the requesting browser for user languages. If present, you could perform a redirect based on the related culture information.

    This approach was a result of being involved in a project that did not permit the use of a geolocation service and and so determining the requesting browser culture information seemed the best approach.

  • Colin 46 posts 146 karma points
    Feb 24, 2020 @ 19:52
    Colin
    0

    Hi guys

    So the component above is chargeable which may not be an option. Alternatively if I query the user language I could use that approach.

    What could/would determine the user language being null/empty?

    Thanks

  • Adam Werner 21 posts 202 karma points MVP c-trib
    Feb 25, 2020 @ 04:21
    Adam Werner
    0

    In some instances, the requested language settings just didn't come across and the prevailing thought was either the browser wasn't sending that information along or that the user never selected a specific language of their choosing.

    In the scenario of a user language being null/empty, the decision was made to send the user to what would be the default language of the web site. For this project, the default language was English and a navigation element was created to allow for switching between the different language offerings.

Please Sign in or register to post replies

Write your reply to:

Draft