codeigniter configure the folder structure
IMHO, doing this on localhost
doesn't make a sense for me, BTW:
Instead of moving the index.php
file, you could move your application
and system
folder somewhere outside the htdocs
(or public_html
on the server) directory and change the paths of those two folder according the directory tree.
There's usually a .htaccess
file inside those two folder which prevent direct accessing the PHP files (by Deny from all
).
However, Moving those folders outside of the web root, improves the security if the .htaccess
stops working for any reason.
For instance, if your index.php
file is located at /home/public_html/project/
, the application
and system
folders should be placed at /home/
path:
home application system public_html project css js .htaccess index.php
And the paths would be:
$system_path = '../../system';$application_folder = '../../application';
you can make your css and js like that and define your path in constants.php like that
define('STYLESHEETS_PATH', 'yoururl/css/');define('SCRIPTS_PATH', 'yoururl/js/');
when getting css you just echo $STYLESHEETS_PATH;
or for js echo $SCRIPTS_PATH