Welcome Guest, Not a member yet? Register   Sign In
subdomain is lost on redirect()->to()
#4

Thanks for the replies.

Kick: current_url() leaves the subdomain out as well.

I managed to solve it using the full path like this:

PHP Code:
return redirect()->to('https://' $_SERVER['HTTP_HOST'] . '/search'); 


However, I think the default behavior of the to() function should be to use the full URL, including the subdomain. And maybe put a second optional boolean argument if you want to redirect to the domain without the subdomain part, e.g.:

PHP Code:
// you are on https://de.mydomain.com/

// takes you to https://de.mydomain.com/search
return redirect()->to('/search');

// takes you to https://mydomain.com/search
return redirect()->to('/search'true); 
Reply


Messages In This Thread
RE: subdomain is lost on redirect()->to() - by divpusher - 05-16-2020, 04:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB