Welcome Guest, Not a member yet? Register   Sign In
Can't view my other pages
#1

[eluser]tabatsoy[/eluser]
Hi

I'm having problem with CI on my server. When I type http://mysite.com/index.php I can view it but when I type or click the link on my index page I get a 404 Not Found, example is when I type http://mysite.com/index.php/site/about.

Thanks and I'll appreciate any response
#2

[eluser]Tri Dang[/eluser]
Hi,

Have you created site controller and about method inside it?
#3

[eluser]tabatsoy[/eluser]
Yes, here is my site controller:

Code:
<?php
    class Site extends Controller {
        function Site() {
            parent::Controller();
            
            $this->load->helper('url');
            $this->load->helper('form');
            
            $this->load->library('form_validation');
        }
        
        //    Index Page
        
        function index() {
            $data['title'] = 'mysite.com | Home Page';
            
            $this->load->view('index', $data);
        }
        
        //    About Page
        
        function about() {
            $data['title'] = 'mysite.com | About Me';
            
            $this->load->view('about', $data);
        }
        
        //    Portfolio Page
        
        function portfolio() {
            $data['title'] = 'mysite.com | Portfolio';
            
            $this->load->view('portfolio', $data);
        }
        
        //    Contact Page
        
        function contact() {
            $this->load->library('email');
        
            $data['title'] = 'mysite.com | Contact Me';
            
            $email = $this->input->post('email');
            $message = $this->input->post('message');
                                
            $this->form_validation->set_rules('email', 'email', 'trim|required|xss_clean|htmlspecialchars|valid_email');
            $this->form_validation->set_rules('message', 'message', 'trim|required|xss_clean|htmlspecialchars');
            
            if ($this->form_validation->run() == FALSE) {
                $this->load->view('contact', $data);
            }
            else {
                $this->email->from($email);
                $this->email->message($message);
                $this->email->to('[email protected]');
                $this->email->subject('Contact Form');
                $this->email->send();

                echo $this->email->print_debugger();
            }
            
            //$this->load->view('contact', $data);
        }
    }//end curly braces for class Site
?>
#4

[eluser]Tri Dang[/eluser]
Thank you,

Another question: have you made any changes to your config.php and routes.php?
#5

[eluser]tabatsoy[/eluser]
in config.php, I changed the base url to http://mysitename.com and I also changed my uri_protocol to request_uri because if I use auto even the index page returns a "404 Not Found".

in routes.php, I changed the default controller to site.

Thanks and Hope that helps
#6

[eluser]Tri Dang[/eluser]
Sorry, I can't help you more.

I'm interested in the solution too.
#7

[eluser]tabatsoy[/eluser]
No problem.

Seems no one's interested with the solution, it's just us
#8

[eluser]fiktionvt[/eluser]
I have the same problem and can not figure it out.




Theme © iAndrew 2016 - Forum software by © MyBB