Welcome Guest, Not a member yet? Register   Sign In
Big Problem! Help Fast! Primary Controller Not Working
#1

[eluser]macleodjb[/eluser]
I've got a big problem and i can't figure it out. I've been working locally on my computer on my website, i just uploaded everything to my server and everthing works fine except for the main controller.

This is my main controller coming right from www.example.com

Code:
<?php

class Home extends Controller {

    function Home()
    {
        parent::Controller();
        session_start();
            
    }
    
    function index(){
    redirect('home/employer');
    }
    
    function employer()
    {
        $data['page_title'] = "";
        $data['page_desc'] = "";
        $data['page_keywords'] = "";
        $this->load->view('home/index', $data);
    }
    
    function freelancer()
    {
        $data['page_title'] = "";
        $data['page_desc'] = "";
        $data['page_keywords'] = "";
        $this->load->view('home/freelancers', $data);
    }
}

everything on the server is fine. the pages and controller are both uploaded and in the correct spot on the server. I'm getting a 404 error on both pages but my URL is redirecting to the proper places. HELP
#2

[eluser]macleodjb[/eluser]
I managed to get the employer section working by changing the function name employer to index and then deleting the index function. I still have the same problem because the freelancer function still gives a 404 error message. Can you not use alternate functions on the main controller or something?
#3

[eluser]jedd[/eluser]
Quote: ... i just uploaded everything to my server and everthing works fine except for the main controller.

What do your web server / CI logs tell you when you hit this page?

The code looks fine - it's probably not a problem in there.

Quote:everything on the server is fine.

That's a big call, given you just said that this page works fine locally, but not on the server! Wink
#4

[eluser]jdfwarrior[/eluser]
Assuming you have your routes set up correctly? Is the Home controller set as your default controller?

Also, instead of doing a redirect from the index function, you could also just call the employer function by doing

Code:
$this->employer();

Not a, YOU HAVE TO DO IT THIS WAY, type of thing though..




Theme © iAndrew 2016 - Forum software by © MyBB