redirect()->to (multidomain website) |
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') Best regards, Gregor
You can create the uri yourself and pass it to the redirect()->to($subdomainTo) method with the exact address
Simple CI 4 project for beginners codeigniter-expenses
The entire HTTP layer is built around certain assumptions of the “current URL” corresponding somewhat to the configuration in Config\App. It’s actually a somewhat tricky business to discern what is typed into the browser location bar. Multidomain support is definitely an area the framework could do better, but I think it needs to happen at a deeper configuration level so that URL Helper functions don’t need to know/care about single/multi domains.
|
Welcome Guest, Not a member yet? Register Sign In |