user5439189
user5439189

Reputation:

Codeigniter : 404 Page Not Found The page you requested was not found

Here i am trying to load abous us page. But the requested page is not found.Please provide solution for this issue.

View:

 <ul class="nav nav-pills">
                    <li><a href="<?php echo $site ?>">HOME</a></li>
              <li><a href="<?php echo $site ?>/CI_timeline/loadaboutus">ABOUT US</a></li></ul>

Controller:

public function loadaboutus()
    {
        $data=$this->data;
        $this->load->view('aboutus',$data);
    }

Upvotes: 3

Views: 7772

Answers (5)

Saied Trefi
Saied Trefi

Reputation: 23

Use

<?php echo base_url('/ContollerName/function Name') ;?> 

and in your controller , add

public function loadaboutus()
    {
       $this->load->helper('url');
        $data=$this->data;
        $this->load->view('aboutus',$data);
    }

Upvotes: 0

HizClick
HizClick

Reputation: 61

Make sure your base folder name and the name you write in $config['base_url'] is the same.

Upvotes: 0

B.Nadesh kumar
B.Nadesh kumar

Reputation: 226

public function loadaboutus()
{
    $data=$this->data;
    $this->load->view('aboutus',$data);
}

Try this:

public function loadaboutus()
{
    $this->load->view('aboutus');
}

Upvotes: 1

amriG
amriG

Reputation: 60

Make sure you have written the proper controller name both in "li" and also at the top of your controller page.

Upvotes: 2

Tariq Husain
Tariq Husain

Reputation: 566

Mybe you did not add index.php

<li><a href="<?php echo $site ?>/index.php/CI_timeline/loadaboutus">ABOUT US</a></li>

or

<li><a href="<?php echo site_url() ?>/CI_timeline/loadaboutus">ABOUT US</a></li>

make sure your controller name start with capital letter.

Upvotes: 2

Related Questions