CodeIgniter Forums
Page not found but welcome.php works. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Page not found but welcome.php works. (/thread-40996.html)



Page not found but welcome.php works. - El Forum - 04-25-2011

[eluser]Unknown[/eluser]
Hi guys,

here's the deal.

My CI basically works but I got sorta issue here.

If I go to my http://localhost/cicms/index.php where I have my CodeIgniter it is all good. So, the welcome message is being displayed but if I create my own file and put it in the "controllers" folder and it basically works as well but after the output I create (like echoing or any other output it shows the "page not found" message.

For example if I run this file

<?php

echo "ok";

?>

I have the following in my browser:

ok
404 Page Not Found
The page you requested was not found.



I'd really appreciate some help.


Page not found but welcome.php works. - El Forum - 04-25-2011

[eluser]pickupman[/eluser]
Welcome to the forums.

Hopefully you have properly coded your controller to have the proper syntax. You should be able output to the browser from a view or controller without any problem. Do you have any other code in the file?

Also, when posting code, it is helpful if you use the code button in the editor. The code button will highlight the syntax, and not mess up quotes/apostrophe marks.


Page not found but welcome.php works. - El Forum - 04-25-2011

[eluser]Aken[/eluser]
Yes, your controllers must extend the proper classes in order to be discovered and utilized by CodeIgniter. http://ellislab.com/codeigniter/user-guide/general/controllers.html


Page not found but welcome.php works. - El Forum - 04-26-2011

[eluser]Unknown[/eluser]
Thanks. That did the trick!