CodeIgniter Forums
Redirect function not working on hosting server - 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 function not working on hosting server (/showthread.php?tid=60307)



Redirect function not working on hosting server - El Forum - 02-26-2014

[eluser]EdemOne[/eluser]
Hi,
I am just finished developing an application which i made use of the redirect() function to send the user to another page. The redirect() function was properly working when i was hosting the application on my local server. But since i have hosted it on an external server(Godaddy Linux Hosting), the redirect() function stops to work. Every time i redirect a user to a page i get a blank page. Can you please help me solve this issue?


Redirect function not working on hosting server - El Forum - 02-26-2014

[eluser]InsiteFX[/eluser]
Do a form search on GoDaddy.



Redirect function not working on hosting server - El Forum - 02-26-2014

[eluser]EdemOne[/eluser]
I did but i didn't get anything related to my problem, is there a way you can help me out?


Redirect function not working on hosting server - El Forum - 02-26-2014

[eluser]EdemOne[/eluser]
I finally solve the problem, the redirect is now working after i remove this statement
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
that comes after the opening php tag from one of my model core functions that i created.


Redirect function not working on hosting server - El Forum - 02-26-2014

[eluser]CroNiX[/eluser]
That's a security feature so that someone can't call your model (or anything else like controllers, etc) directly from the URL. BASEPATH gets defined at the bottom of index.php and CI uses it all over the place internally, so it should exist since everything routes through index.php before anything else.

You may have gotten it working, but most likely you have a bigger issue going on and you now have opened a security hole. I'd advise you to keep looking for the cause.

If you google "codeigniter godaddy", you will see plenty of issues with them as a host, and some workarounds. Personally, I'd never use them as they don't seem to have a standard setup.