Welcome Guest, Not a member yet? Register   Sign In
redirect()->to (multidomain website)
#1

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
Reply


Messages In This Thread
redirect()->to (multidomain website) - by Gregor - 07-10-2022, 09:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB