Welcome Guest, Not a member yet? Register   Sign In
Routing problem in CI
#1

[eluser]kalpesh[/eluser]
Hi
I try to remove welcome.php file from routes.php
And I change it to Home.php
The code is
Code:
$route['default_controller'] = "Home";

It is working fine in Localhost
But when i upload it in shared web hosting it is giving me error that
Code:
404 Page Not Found
The page you requested was not found.

So there is another way to call default controller in CI.
Please Help me
I am stuck here.
#2

[eluser]emanon[/eluser]
You will also need to rename your welcome.php controller file (system/application/controllers/welcome.php) to home.php and edit that file so that it looks like this....


class Home extends Controller {

function Home()
{
parent::Controller();
}

function index()
{
$this->load->view('welcome_message');
}
}
#3

[eluser]Mike Ryan[/eluser]
Is your file named Home.php or home.php? If your shared host is running Linux, they must both have the same capitalisation.

Does browsing to www.yoursite.com/home/ work?
#4

[eluser]kalpesh[/eluser]
Yes it work.
When i try to browse
www.yourdomain.com/index.php/Home

And My file Name is Home.php
#5

[eluser]kalpesh[/eluser]
Yes it works when i rename the file home.php from Home.php
Thanks for replying.
I really appreciate your help.
Thanks again
#6

[eluser]Mike Ryan[/eluser]
No problem kalpesh, I'm glad I could help :-)




Theme © iAndrew 2016 - Forum software by © MyBB