Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting 404 error after uploaded the data on server

I am using codeigniter. I did the project and uploaded on server but when I am running my URL getting 404 not found. I had changed the base_url path but still getting issue. On local server its working. I have created on folder on server name is test and inside test there is admin folder, inside admin all codeigniter code available.

$config['base_url'] = 'http://test.hybreed.co/admin/'; 

$config['index_page'] = 'index.php';// also remove the index.php 

$config['uri_protocol'] = 'AUTO';

$route['default_controller'] = 'home';// i have created home in controller

The database is ok. Where am I wrong?


1 Answers

Rename home.php under controllers folder to Home.php and inside that file rename class home to class Home and then check.

Controllers

Controller class names should be all lowercase, except the first letter.

If your URL is www.example.com/gallery, the controller name is Gallery.
If your URL is www.example.com/admin_folder, the controller name is Admin_folder.

Controller file names should match the class name, but be all lowercase.

Gallery :: gallery.php
Admin_folder :: admin_folder.php

Controller methods should be all lowercase as well. There is some flexibility with uppercase, but similar to URLs, there are opportunities where it can goof something up.

like image 169
AnkiiG Avatar answered Mar 19 '26 05:03

AnkiiG



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!