CodeIgniter Forums
You don't have permission to access /CodeIgniter/application/controllers - 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: You don't have permission to access /CodeIgniter/application/controllers (/thread-53291.html)



You don't have permission to access /CodeIgniter/application/controllers - El Forum - 07-18-2012

[eluser]Unknown[/eluser]
i'm new to codeigniter, trying to follow instruction on how to install it from the user manual but whenever i try a sample of a program in a controller i like this
<?php

class Site extends CI_Controller(){
function index(){
echo'hello';
}
}
?>


i got this error: Forbidden! You don't have permission to access /CodeIgniter/application/controllers

i'm using codeigniter v 2.1.2

please help!!





You don't have permission to access /CodeIgniter/application/controllers - El Forum - 07-18-2012

[eluser]johnpeace[/eluser]
Try calling the parent constructor...

Code:
public function __construct()
{
parent::__construct();
}



You don't have permission to access /CodeIgniter/application/controllers - El Forum - 07-18-2012

[eluser]CroNiX[/eluser]
It looks like you tried to access your controller directly in the url, like http://yoursite.com/Codeigniter/application/controllers/site, which you can't do and is not how CI works with URLs.

You would use:
http://yoursite.com/index.php/site
or
http://yoursite.com/site if you use the htaccess rules for making CI work without index.php in the url