Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6625637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:47:52+00:00 2026-05-25T21:47:52+00:00

I am doing some testing with CI and have it running in a folder.

  • 0

I am doing some testing with CI and have it running in a folder. http://www.example.com/sub-folder/ for instance

My directory structure is like this (where / is sub-folder/):
/
|-/system
|-/application

I have eclipse as my IDE with 2 projects, 1 for system, 1 for application, where application is my project that includes a reference to system.

My .htaccess file prevents access to system directory. I would like to have my images and CSS placed into: application/resources/images and application/resources/css respectively. I would like to be able to use <link rel="stylesheet" href="/sub-folder/css/style.css" /> However, after spending some time testing and searching, I haven’t been able to get the CSS file to load from the application directory.

What do I need to change or add in my .htaccess to be able to do this?

The contents of my .htaccess follows:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

### Canonicalize codeigniter URLs

# If your default controller is something other than
# "welcome" you should probably change this
RewriteRule ^(welcome(/index)?|index(\.php)?)/?$ / [L,R=301]
RewriteRule ^(.*)/index/?$ $1 [L,R=301]

# Removes trailing slashes (prevents SEO duplicate content issues)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ $1 [L,R=301]

# Removes access to the system folder by users.
# Additionally this will allow you to create a System.php controller,
# previously this would not have been possible.
# 'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]

# Checks to see if the user is attempting to access a valid file,
# such as an image or css document, if this isn't true it sends the
# request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:47:53+00:00Added an answer on May 25, 2026 at 9:47 pm

    Instead of

    <link rel="stylesheet" href="/sub-folder/css/style.css" />
    

    You could do

    <link rel="stylesheet" href="<?php echo base_url('application/sub-folder/css/style.css'); ?>" />
    

    I usually keep my assets in the root folder (where the main index.php file is) and use this asset library to load everything.

    If you want to keep your assets in application/sub-folder you could do this:

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing some trial testing awith Amazon ec2 boxes, deploying flex apps running
I have been doing some testing whilst using Jquery UI datepicker and have found
I have been doing some testing with ObjectiveResource (iOS->Rails bridge). Things seem to work,
I was doing some testing and straight LINQ-to-SQL queries run at least 80% faster
I'm currently doing some GUI testing on a ASP.net 2.0 application. The RDBMS is
I've been doing some performance testing around the use of System.Diagnostics.Debug, and it seems
I'm a doing some blackbox testing of a ASP.Net website and I need to
I am doing some initial testing for a Rails app which will be deployed
I'm doing some unit testing, and some of the code is checking to see
I was working with quality yesterday doing some formal testing. In their procedure they

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.