CodeIgniter Forums
Error 403 or No direct script access allowed - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forumdisplay.php?fid=29)
+--- Thread: Error 403 or No direct script access allowed (/showthread.php?tid=62601)



Error 403 or No direct script access allowed - axelvdk - 08-04-2015

Hello !

I have a problem with a link on my local web site. I try to redirect the user with a controller in a <a href="my_controller">link</a> but I can't make it work.

Or the problem is a 403 error : I can fix it deleting the htaccess file but the problem wich happens is : class CI_controller not found in : class my_controller extends CI_controller {}.

Either the problem is : No direct script access allowed when I put the this line of code : defined('BASEPATH') OR exit('No direct script access allowed'); at the top of my controller file.

It's really boring, I can't work because can't access to my file... I'm working with wamp server but I do have no ideas about what I have to do.

Thank's for reading me,


Axel


RE: Error 403 or No direct script access allowed - gadelat - 08-04-2015

All of your links need to start with index.php file


RE: Error 403 or No direct script access allowed - axelvdk - 08-05-2015

Yes, but here the problem was solved easely, I had to put site_url() function in the link. Now, everything is working well.

Thank's a lot,

Axel