Question

I'm currently using Version 2.1.4 of code igniter

and it is stated in config.php to change this:

$config['base_url'] = 'http://localhost/test/';

to the link to your url

$config['base_url'] = 'http://schoolooky.likesyou.org/';

but after changing that and also changing the sql credential i still get a 404 error on my site. any idea on what i missed to do here?

full url based on my local is this:

http://schoolooky.likesyou.org/index.php/schooly/index/

I did not touch anything on the htaccess part as i didnt need anything to do with it.

Also this is set by default:

$config['index_page'] = 'index.php';

controller

class Schooly extends CI_Controller {

    public function index(){
        $session_id = $this->session->userdata('username');
        if($session_id){
            $this->load->view('home.php');
        }else{
            $this->load->view('index');
        }
    }
    public function admin(){
        $session_id = $this->session->userdata('username');
        if($session_id != "sadmin"){
            if(!$session_id){
                $this->load->view('index');
            }else{
                $this->load->view('home');
            }

        }else{
            $this->load->view('admin.php');
        }
    }
    public function about(){
        $this->load->view('about.php');
    }
    public function home(){
        $session_id = $this->session->userdata('username');
        if($session_id != NULL){
            $this->load->view('home.php');
        }else{
            $this->load->view('index');
        }
    }
    public function register(){
        $session_id = $this->session->userdata('username');
        if($session_id == NULL){
            $this->load->view('register.php');
        }else{
            if(!$session_id){
                $this->load->view('index');
            }else{
                $this->load->view('home');
            }
        }
    }

    public function check(){
        $this->load->model('check');
        $logcheck = $this->check->check($this->input->post('username'),$this->input->post('password'));

        if($logcheck == "admin"){
            $this->load->view('admin.php');
        }else if($logcheck == "user"){
            $this->load->view('home.php');
        }else{
                $this->load->view('index.php');
        }
    }

    public function ucheck(){
        $this->load->model('u_check');
        $rowcount = $this->u_check->check_user($this->input->post('username'));

        if($rowcount == "1"){
            echo "1";
        }else{
            echo "0";
        }
    }

    public function regp()
    {
        $this->load->model('reg_p');
        $reg_check = $this->reg_p->reg_user($this->input->post('firstname'),$this->input->post('lastname'),$this->input->post('username'),$this->input->post('password'));
        $this->load->view('home.php');
    }

    public function logout()
    {
        $this->load->model('logout');
         $this->logout->logout();
        $this->load->view('index.php');
    }

    public function school(){
        $this->load->view('school.php');
    }

    public function comments(){
        $session_id = $this->session->userdata('username');
        $this->load->model('comments');
        if($session_id){
            $comment = $this->comments->comments($this->input->post('comment'),$this->input->post('schoolid'));
        }
        echo $comment;
    }

    public function delcom(){
        $session_id = $this->session->userdata('username');
        $this->load->model('delcom');
        if($session_id){
            $comment1 = $this->delcom->delcom($this->input->post('id'),$this->input->post('schoolid'));
        }
        echo $comment1;
    }

    public function rate(){
        $session_id = $this->session->userdata('username');
        $this->load->model('rate');
        if($session_id){
            $rates = $this->rate->rate($this->input->post('id'),$this->input->post('value'),$this->input->post('user'));
        }
        echo $rates;
    }

    public function u_school(){
        $this->load->model('u_school');
        if($this->input->post('schoolid')){
            $school = $this->u_school->u_school($this->input->post('schoolid'));
        }else{
            $school = $this->u_school->u_school1($this->input->post());
        }
        echo $school;
    }

    public function upload_s(){
        $this->load->model('upload_s');
        if($this->input->post('schoolname')){
            $school_add = $this->upload_s->upload_s($this->input->post());
        }
        echo $school_add;
    }

    public function d_school(){
        $this->load->model('d_school');
        if($this->input->post('schoolid')){
            $school_d = $this->d_school->d_school($this->input->post('schoolid'));
        }
        echo $school_d;
    }
}
Was it helpful?

Solution

it should be case sensitivity issue ..

try this url click here

OTHER TIPS

Please check you have a controller with name schooly and in this index() also check case-sensitive for controller class name

Upload your all codeigniter/test Dir files on the root of schoolooky.likesyou.org

set config :-

$config['base_url'] = 'http://schoolooky.likesyou.org/';

set databse :- application/config/databse.php

$db['default']['hostname'] = 'localhost'; // your host
$db['default']['username'] = 'root'; // your db username
$db['default']['password'] = ''; // your db password
$db['default']['database'] = 'eg'; // your db name

set routes :- application/config/routes.php

$route['default_controller'] = "home"; //default on hit url 

No need to any htaccess and other config for default

You need to set schooly as your default controller...

$route['default_controller'] = "schooly";
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top