0

I am using codeigniter for one of my project. I am facing a problem with CSS. I am not able to load CSS. I am getting 404 error while loading the css. All my other functions are fine. Here is my view page-

<HTML>
 <HEAD>
 <link href="<?php echo base_url(); ?>bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css"  />
  </head>

My .htaccess is

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

Rest all my functions are working fine. I mean I am able to access records via example.com/users/show or example.com/users/show/

I think I am missing something. Can you please help me in this.

4
  • Meanwhile I changed my .htaccess with following - RewriteCond $1 !^(index\.php|images|CSS|JS|robots\.txt) but got the same issue Commented May 27, 2014 at 21:07
  • When you view the source of the webpage, does it show the correct URL ? Do you get the css file when you type the url directly into the browser? Commented May 27, 2014 at 22:44
  • add bootstrap like this RewriteCond $1 !^(index\.php|images|bootstrap|robots\.txt) and try to access css directly, see what error you get Commented May 28, 2014 at 5:09
  • also post the source code of you css from generated page Commented May 28, 2014 at 5:18

1 Answer 1

1

Add below code in .htaccess

RewriteEngine on
RewriteBase /Project Folder PATH
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt)
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.