4

I have this on my $route on CI

$route['(:any)'] = 'main/index/$1';
$route['default_controller'] = 'main/index';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

I also downloaded a bootstrap theme from startbootstrap and i moved

css, fonts, images, js

Into the root,where application folder resides

So the problem is that codeigniter reads 'css' as a controller so the views can't access the css.

I am also watching a tutorial on how to integrate it. [Integrate a Bootstrap Template into Code Igniter Learning Basics of MVC Frameworks][1]

From the point where he added htaccess on the root i keep having this error,

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

I am searching through the comment section of that video and am trying to remedy it but i don't wanna do anything drastic since it may ruin my set up or any unwanted errors.

Or perhaps is there any other way i can access the css from the view?

JM Canson
  • 91
  • 5
  • can I see how you organized your files? Where did you put your assets? – vsogrimen May 15 '15 at 05:00
  • None of the answer will solve your problem.You need to write a .htaccess.The rule should be if a file found execute it or go to index.php.You can see the [first answer of this question](http://stackoverflow.com/questions/15481035/removing-index-php-in-codeigniter-using-htaccess-file/17941534#17941534) – Shaiful Islam May 15 '15 at 05:40

1 Answers1

1

It's simple.

In your root directory, just create an /assets folder where you can put /css', '/js', '/images folders like this structure:

|- application
|- system
|- assets
    |- bootstrap
    |- css
    |- images
    |- js
    |- fonts

And in your view template you can just call your assets like this:

CSS

<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">

JS scripts

<script src="assets/bootstrap/js/bootstrap.min.js"></script>

and you're done.

Btw, you just said that:

I also downloaded a bootstrap theme from startbootstrap and i moved css, fonts, images, js Into the root, where application folder resides

I advise that it would be much better if you put it on one folder, which in this case is /assets folder, so it would be more organized.

Vainglory07
  • 5,073
  • 10
  • 43
  • 77