Chris So
Chris So

Reputation: 833

404 Page Not Found The page you requested was not found - CodeIgniter

I am new on using CodeIngiter framwork. I tested my code on localhost. It works perfectly.

But when I put the files on remote server. It gives me:

"404 Page Not Found - The page you requested was not found."

when I call the controller through url: http://www.mysite.com/dev/application/facebook/show_info

However the welcome page shows correctly. I can modify the welcome.php controller to check the base url. Then, I test the url so I try to follow the letter case (since my controller class is called: Show_Info.php) http://www.mysite.com/dev/application/facebook/Show_Info

It shows another error message: "An Error Was Encountered - Unable to locate the model you have specified: fb_user_model"

I search via google, stack overflow, .... etc but I still cannot find the solution. Please help and sorry for my bad English.

file tree:

(http://www.mysite.com)
│
└──application 
    │
    ├───dev
    │   ├───codeigniter
    │   │    |───system
    │   │    └───application
    │   │         |─controller
    │   │         |  ├welcome.php
    │   │         |  └facebook
    │   │         |     └Show_Info.php
    │   │ 
    │   ├───index.php
    │   ├───.htaccess
    │   |

.htaccess:

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

base_url:

http://www.mysite.com/dev/application/

Upvotes: 0

Views: 7288

Answers (4)

Nazmus Shakib
Nazmus Shakib

Reputation: 19

Try to make all conterollers and models files first letter uppercase. Ex: myController.php -> MyController.php

Upvotes: 0

alexandre1985
alexandre1985

Reputation: 1116

If you have developed on windows on localhost and the server is linux you have to put the controllers and models php files to start with an uppercase.
For example: ctl_base.php -> Ctl_base.php

Upvotes: 1

Mohammad Ismail Khan
Mohammad Ismail Khan

Reputation: 651

First of all you should remove codeigniter folder from you structure. Put you application, system folders directly in you DIV folder. And also in htaccess

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

And change base_url http://www.mysite.com/dev/ I hope this will help you

Upvotes: 2

MJ X
MJ X

Reputation: 9054

change your base_url to http://www.yoursite.com don't put the application folder name in base url the index.php file will read it because it is set from the index.php. i hope this will solve your problem

Upvotes: 1

Related Questions