Redirect not working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Redirect not working (/showthread.php?tid=33997) |
Redirect not working - El Forum - 09-15-2010 [eluser]Larry Wakeman[/eluser] I am doing a logout by passing an additional segment 'logout' so I am going to /foo/bar/logout. In the logout code in the index function of my controller (I am using a single controller with a wild card route and letting the controller decide if the page exists and to display the correct content) so I put the following in: Code: if (stripos(uri_string(), 'logout') !== false) Redirect not working - El Forum - 09-15-2010 [eluser]Larry Wakeman[/eluser] I found the problem. Seems that it works with a full url as follows: Code: if (stripos(uri_string(), 'logout') !== false) Redirect not working - El Forum - 09-15-2010 [eluser]danmontgomery[/eluser] Sounds like you have a bad value set in $config['base_url']. Redirect not working - El Forum - 09-16-2010 [eluser]Larry Wakeman[/eluser] Yeah, that was the problem. Now if I change the config.php line: Code: $config['base_url'] = "http://example.com/"; to: Code: $config['base_protocol'] = 'http'; I will never have that problem again. |