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
    Mar 12, 2020 @ 07:50
    Colin
    0

    Where to add custom redirect

    Hi

    My Umbraco structure is as follows

    Site 1
      Site 1 English
      Site 1 German
    Site 2
      Site 2 English
      Site 2 German
    

    I have a third party component which allows me to retrieve the visiting users country and redirect them to their country's site. So if a user visited site 1 and they're from USA I could redirect them to the English version but if the user is from Germany I would like to redirect them to Germany's site.

    Where would the appropriate place be to add this code?

    Thanks

  • Mila Pandurska 75 posts 354 karma points
    Mar 12, 2020 @ 12:40
    Mila Pandurska
    1

    Hi Colin, In my persional experiance I do this in DefaultController which catches the request before Umbraco. You can check there the country and redirect the user to the correct language version. A good strarting point is the official Umbraco documentation here.

  • Colin 46 posts 146 karma points
    Mar 12, 2020 @ 14:23
    Colin
    0

    Hi Mila

    I'm not using MVC unfortunately. As I understand I would need to create or change the Global.asax file. Is this on the correct lines? If so any examples I could follow to ensure I don't break the existing functionality or cause a random bug?

    Thanks

  • Colin 46 posts 146 karma points
    Apr 01, 2020 @ 05:34
    Colin
    0

    Anyone with any ideas?

Please Sign in or register to post replies

Write your reply to:

Draft