Hitesh
Hitesh

Reputation: 562

CSS file not loading in Codeigniter

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.

Upvotes: 0

Views: 65

Answers (1)

Jigar Patel
Jigar Patel

Reputation: 207

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] 

Upvotes: 1

Related Questions