I’m trying install my codeigniter application in a sub folder: http://website.com/sub_folder
And I want that this site is accessible through: http://website.com/
I have the following info in my application/config.php file for the base url: $config['base_url'] = 'http://website.com/sub_folder';
This is my .htaccess:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|captcha|assets|favicon\.gif|robots\.txt)
RewriteRule ^(.*)$ /sub_folder/index.php/$1 [L]
The problem is that when I change the $config['base_url'] to access my asset files, like css etc al my other links using $base_url() point to : http://website.com/sub_folder too instead of http://website.com/
If I understand what you want to achieve, you’re doing it wrong, simply place
index.phpfile in your root folder and your application to the sub-folder.Change
systemandapplicationpaths inindex.phpto where exactly they are located and you’re done.In any case, if it’s possible, consider moving
applicationandsystemfolders out of the root directory as it will cover hundreds of potential security holes.