Redirect user to correct channel on first arrival

We would like to send users to the correct channel if they’re coming from an outside URL. This would be done by checking the country on the address for already signed in users or by an IP lookup for guests and then redirect to the URL of the channel for the country we find.

Where would be the best place to do this in the code? Looks like in RequestModelActionFilter.OnActionExecuting could work but maybe there a better place for this?

Litium version: 8.12

Any suggestions on this?

We’ve implemented this in ControllerBase! (In Litium 7, for .net core I would use a middleware)

Thanks. That was on the list of potential places to put it.

We have done the implementation in RequestModelActionFilter.OnActionExecuting now. We haven’t really tested it yet but it seems to work fine.

In one of my projects we need to check IP-addresses for access and we solved it by injecting Middleware in Startup.cs using app.UseMiddleware and from there read the HttpContext stuff

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.