CodeIgniter Forums
Codeigniter controller's function are not getting accessed? - 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: Codeigniter controller's function are not getting accessed? (/showthread.php?tid=47314)



Codeigniter controller's function are not getting accessed? - El Forum - 12-03-2011

[eluser]Unknown[/eluser]
Hi
I am new to CI.
I have read CI documentation and viewed lot of tutorials.

I have downloaded the new 2.1.0 version.
Then, I have added a new file in the application/Controllers/ called "site.php".
Code:
<?php
class Site extends CI_Controller {

public function index()
{
  echo "Hello Buddy";
}
public function ok() {
  echo "Again Hello Buddy";
}
}
?>
In config/routes.php, i modified the following
Code:
$route['default_controller'] = "site";

ci is diretory which has all CI files.

In browser i tried to get the page with following links

**http://127.0.0.1/web/ci***
**http://127.0.0.1/web/ci/index.php***

above both links are displaying "Hello Buddy". Its works fine here !!.


But links
**http://127.0.0.1/web/ci/ok.php**
**http://127.0.0.1/web/ci/ok**

Does not show "Again Hello Buddy".
It shows as follows.
Code:
==========================================================================
Not Found
The requested URL /web/ciCont/ok.php was not found on this server.
Apache/2.2.20 (Ubuntu) Server at 127.0.0.1 Port 80
==========================================================================
What could be wrong in my code?? Please Help??
Thanks
ND