CodeIgniter Forums
Redirect function not working in the different server - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Redirect function not working in the different server (/thread-23604.html)



Redirect function not working in the different server - El Forum - 10-16-2009

[eluser]y0rkez[/eluser]
Hello, I'm newbie using CI framework, I've finished working my first CI framework project, but I have a problem on redirecting URL, example for login authorization.
I've run my application on my server and it's done, but when I run on another server it has a problem with the following error:

Quote:A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/sloki/user/h26319/sites/blabla.com/www/system/libraries/Exceptions.php:164)

Filename: helpers/url_helper.php

Line Number: 541

I don't understand what its mean, does anybody has solution?


Redirect function not working in the different server - El Forum - 10-16-2009

[eluser]rogierb[/eluser]
Did you check for spaces after php closing tag?

It might be something a simple as that.


Redirect function not working in the different server - El Forum - 10-16-2009

[eluser]y0rkez[/eluser]
OK thank you *rogierb for your suggestion, I'll try to check it.


Redirect function not working in the different server - El Forum - 10-16-2009

[eluser]BrianDHall[/eluser]
Alternatively it can be an encoding issue, commonly coming up with UTF-8 and how some editors handle it.

This is also common in transitions between unix and windows servers, as some editors add extra junk because they don't understand the line breaks very well. Also note that ?> is unnecessary in things like controllers, models, etc - don't use them to avoid the chance of having an extra line-break or space at the end of a file that screws up your headers.


Redirect function not working in the different server - El Forum - 10-22-2009

[eluser]y0rkez[/eluser]
Thank you *BrianDHall, I had found the solution, the server doesn't support header_refresh so I changed with header_location and it can be run.