Thanks for the quick answer!
The version is 8.2.48.
I was checking the code of the method CMS.URLRewritingEngine.URLRewriter.RedirectToDomain, I did a test copying the code in a beginrequest handler, there is a condition that is not letting pass because it is comparing the relative paths, I don't now pretty sure why
string url1 = URLHelper.RemoveProtocolAndDomain(currentResolver.ResolveMacros(text, (MacroSettings) null).TrimEnd('/'));
string str2 = URLHelper.RemoveProtocolAndDomain(StringExtensions.ToLowerCSafe(CMS.Helpers.RequestContext.CurrentURL).TrimEnd('/'));
string domain = URLHelper.GetDomain(url1);
if ((str2 != url1 || domain != string.Empty && CMSString.Compare(domain, str1, true) != 0) && !URLHelper.IsExcludedSystem(CMS.Helpers.RequestContext.CurrentRelativePath))
I was wondering why are you doing this comparison? I think here is the key to resolve my issue.