Click here to Skip to main content
15,748,930 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am using PHP's CodeIgniter framework to develop a small website. I am using twitter bootstrap 3.0 to beautify the website. I am facing some serious issues in understanding the anomalous behavior of my bootstrap files. Sometimes they get loaded and sometimes they don't.

when I use the URL localhost/money_tracker/index.php/login/ bootstrap gets loaded properly where as localhost/money_tracker/ doesn't load any bootstrap file.
[Note: I've set my default controller in route file a login.]

When checked sometimes it says 404 File not found whereas some other time it says 403 Forbidden.

I even changed the permission of the folder containing bootstrap files to 777.

I am new to web programming.
Updated 30-Jan-15 11:07am
Sergey Alexandrovich Kryukov 30-Jan-15 19:43pm    
If you are new to Web programming, you are very welcome to ask your questions.
Unfortunately, you are not asking. You are just telling us you are having different kind of troubles. So what? It is not helpful. Try to understand what information would it take to resolve the problem and explain it all properly. And, finally, ask some question.

1 solution

Though your question is very vague, I will answer based on what I have understood from your question. You might want to try removing index.php on you url. Follow these simple steps:

1. Open config.php which can be found on the application folder.
2. Remove index.php on $config['index_page'] = 'index.php';
3. Outside your application folder. You can find an .htaccess file. Edit it and replace the contents with:

<ifmodule mod_rewrite.c="">
    RewriteEngine On
    RewriteBase /<codeigniter-folder-name-here>/

    #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]
    #When your application folder isn't in the system folder
    #This snippet prevents user access to the application folder
    #Submitted by: Fabdrol
    #Rename 'application' to your applications folder name.
    RewriteCond %{REQUEST_URI} ^application.*
    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]

    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php

Note: When removing index.php. You can access your files without the /index.php/ in your url anymore.

Example :
localhost/money_tracker/index.php/login/ ---> localhost/money_tracker/login

If your bootstrap files are still not showing. Double check your stylesheet links.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900