No direct script access allowed

Hi guys,

i am new to codignitor. I can’t able to get my controller to work.
i spent half a day now. i am having a hard time with the error “No direct script access allowed”.

Please help me to resolve this issue.

Trouble Shooting

i tested the base path and it shows the path correctly.
i just added

echo base_url();

and iscorrectly printing the project folder as shown below.

Customers.php Controller


defined('BASEPATH') OR exit('No direct script access allowed');

class Customers extends CI_Controller {

    public function __construct() {
        $this->load->helper('url', 'form');

    public function index() {


View folder has header.php and footer.php files. Which should be loading when Customers Controller is called.

So when executed the URL

the error is appring.

What is in your index.php?

i am so sorry, looks like i had banged my head with codig version 4.
i just follow another tuto on how to setup coding 3 and now evything is fine.

@rpkamp Thanks for your intrest in resolving my issue. i am now alright with version 3.


1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.