CodeIgniter Forums
Routing problem in CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Routing problem in CI (/thread-17658.html)



Routing problem in CI - El Forum - 04-11-2009

[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.


Routing problem in CI - El Forum - 04-11-2009

[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');
}
}


Routing problem in CI - El Forum - 04-11-2009

[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?


Routing problem in CI - El Forum - 04-11-2009

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

And My file Name is Home.php


Routing problem in CI - El Forum - 04-11-2009

[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


Routing problem in CI - El Forum - 04-11-2009

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