Hi,
for multidomain website redirect()->to() doesn't work properly and redirects to main domain, instead of redirecting to relative URL
Code:
public function to(string $uri, ?int $code = null, string $method = 'auto')
{
// If it appears to be a relative URL, then convert to full URL
// for better security.
if (strpos($uri, 'http') !== 0) {
$uri = site_url($uri);
}
return $this->redirect($uri, $method, $code);
}
I would suggest adding another parameter to this function to override security measure and redirect to relative URLs or use domain under which controller works.
Best regards,
Gregor