Welcome Guest, Not a member yet? Register   Sign In
redirect url helper redirect to localhost
#10

(05-13-2015, 08:03 AM)rtorralba Wrote: When base_url is not set redirect('controller/method') redirect to http://localhost/index.php/controller/method, the other projects in ci 2 redirect to the current domain (http://example.dev/index.php/controller/method).

I think that something change in ci 3 because the documentation in config file has changed, now in ci 3 say that is recomended set this value.

The localhost value would seem to point to the else condition here:
https://github.com/bcit-ci/CodeIgniter/b...ig.php#L72

Are you using 2.2 for your CI2 projects, or an earlier version?

2.2 and 3.0 use the same code for this particular section, and I can't really figure out where the localhost would come from, otherwise. The big difference between <=2.1 and >=2.2 on this line is the preg_match() validation, so, if the HTTP_HOST value fails the validation, it would revert to localhost.
Reply


Messages In This Thread
RE: redirect url helper redirect to localhost - by mwhitney - 05-13-2015, 08:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB