Routing problem in CI |
[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 So there is another way to call default controller in CI. Please Help me I am stuck here.
[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'); } }
[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?
[eluser]kalpesh[/eluser]
Yes it work. When i try to browse www.yourdomain.com/index.php/Home And My file Name is Home.php
[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
|
Welcome Guest, Not a member yet? Register Sign In |