0

I am building an admin section in codeigniter for my site and wanted to have a separate CSS folder for the CSS files for the admin section as they are going differ to those for the main site.

Current my CSS files sit in assets/css

I added and extra folder to that called admin and placed my new CSS files in that ie

assets/css/admin/css/style.css

However when I click the link in source code view to that stylesheet, I get a 404.

My current .htaccess reads as follows:

RewriteEngine On
RewriteCond $1 !^(index\.php|assets|editor|css\/|admin|js|scripts|images|img|media|xml|user_guide|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

What would I need to do to enable this file.

Note the strange thing is I have 4 CSS files in the folder, two of them whem clicked in the view source ope okay, and 2 of them contain the 404.

3
  • How are you creating the links to the CSS in your view(s)? Are they relative or absolute? Commented May 18, 2013 at 9:00
  • Have you tried removing the \/ in front of css? Commented May 18, 2013 at 10:09
  • Hi there, the links that I am using are as follows: <link href="<?php echo base_url('assets/css/admin/style.css') ?>" rel="stylesheet">,Yes there was no \/ in the first instance and I added that as a way of getting it working Commented May 18, 2013 at 11:04

1 Answer 1

1

use this:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.