I have the following directory structure of Codeigniter Folder. You can see that I have put all my assets in the assets
folder at the root of the application.>
You have multiple options here. The easiest one is to move the assets folder to the same level as the application so that your directory structure is:
Because the assets folder is not in a folder with the .htaccess with Deny From All
it won't be blocked by your web server.
Alternatively you can add an .htaccess file in the assets folder with the following rule:
# /assets/.htaccess
Allow from all
I haven't tested this but I think it should work.
Another option is to change the .htaccess and put an exception on the assets folder but it's a very bad idea (with security implications) to remove the Deny From All
without writing alternate rules to lock all folders that shouldn't be accessible.
Also, set your base_url
to the folder containing application, system and assets directories (this folder contains Codeigniter's bootstrap/front controller index.php).
Additionally, I would advise you to echo your urls using the base_url() function:
base_url("assets/css/bootstrap.min.css");
OR to call a controller/route
base_url("controller/method");
The base_url function takes into account the value of $config['index_page']
as well as the necessary leading/trailing slashes.