tags:

views:

113

answers:

3

I've just published my site, created with codeigniter.

the entire directory is in my public folder, including the config file (in public/system/application/config).

I just wanted to double check: do I have to move this file to another, non public, directory? I think codeigniter doesn't allow any direct access, but I am not 100% sure..

thanks, P.

A: 

It shouldn't be necessary to move these to a non public directory. If you try to access them via the web, you get the message: "No direct script access allowed".

In other words, you can't access the config contents via the web!

Phill Sacre
A: 

Hi,

If you give the correct permitions to your directory you should not have any problem with the standart location of the file.

Regards,
Pedro

Pedro
+5  A: 

Ideally you should move both the system folder and the application folder out of the web root. You can modify the path's in the index.php, so all that is available in web root is your index.php, JS, CSS, etc.

That is not always possible, so as long as you are blocking requests to sensitive files with if(defined()) and .htaccess you will be fine.

Phil Sturgeon
Yes, this is exactly right. Check for if ( ! defined('BASEPATH')) exit('No direct script access allowed'); at the top of all of your config files - if it's there, you're safe. Then someday when you have time to fiddle around, move the CI application folder out of your public web folder and into the web root.
Summer