I have to move the config file from the codeigniter directory

I just posted my site built with codeigniter.

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

I just wanted to double check: do I need to move this file to a different non-public directory? I think codeigniter doesn't allow direct access, but I'm not 100% sure.

thanks, R.

+2


a source to share


3 answers


Ideally, you should move both the system folder and the application folder from the root of the website. You can change the path in index.php, so whatever is available in the root of the website is your index.php, JS, CSS, etc.



This is not always possible, as as long as you block sensitive file requests with if (defined ()) and .htaccess everything will be fine.

+6


a source


You don't need to move them to a non-public directory. If you try to access them over the Internet, you will receive a message: "No direct script access".



In other words, you cannot access the contents of the configuration over the Internet!

0


a source


If you give the correct permissions for your directory, you shouldn't have any problems with the default file location.

Regards,
Pedro

0


a source







All Articles