I am using Codeigniter 2..3 Apache 2.2.17 PHP 5.3.4.

I am wish to give use of all of the files and subfolders within the 'public' folder. I have browse the articles within the Codeigniter wiki as well as all first 5 pages on the internet results and located nothing that actually works.

This is actually the files tree:

- application
    - public
        - css
            - style.css
        - img
        - js
- system
- .htaccess

And this is actually the .htaccess I am using to get rid of 'index.php' in the URL and then try to give use of the folder:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /CodeIgniter_2.0.3

#Removes access to the system folder by users.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]

#Checks to see if the user is attempting to access a valid file,
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

#Enable access to the images and css folders, and the robots.txt file
RewriteCond $1 !^(index\.php|public|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

The web site is working and 'index.php' is no more necessary for the URL, however the last condition should really give use of the general public folder, nevertheless its no longer working for me personally, which means this http://localhost/CodeIgniter_2.0.3/public/css/style.css file isn't found.

In config.php I've:

$config['base_url'] = 'http://localhost/CodeIgniter_2.0.3/';
$config['index_page'] = '';

Help. Thanks!!!

Together with your current structure, you have to alter the last RewriteCond to:

RewriteCond $1 !^(index\.php|application\/public|robots\.txt)

since your .htaccess is incorporated in the same directory as the application folder as well as your public folder is within the application folder, you have to clearly mark the applyingOropen public folder as accessible.