Welcome Guest, Not a member yet? Register   Sign In
Please help to newbie. 404 while controller/method url
#1

[eluser]Unknown[/eluser]
Hello,

I am conscious user so I tried to search similar problems in the forum. Looking up for 2 hours and no result. So I decided to ask myself. Sorry if I didn't see same which is already posted before.

I created my .htaccess file from http://codeigniter.com/wiki/mod_rewrite

My problem;

Code:
<?php

class Welcome extends Controller {

    function Welcome()
    {
        parent::Controller();
        $this->load->helper('url');
        $this->load->helper('form');
    }
    
    function index()
    {
        $data['title'] = "My title";
        $data['header'] = "Hello";
        $data['query'] = $this->db->get('gbook');
        $this->load->view('gbook_view', $data);
    }
    
    function comments()
        {
            echo 'testing 1,2,3';
    }
}

I have gbook_view.php under views folder and it is fine. I can fetch and list guestbook entries.

Then I have link under every row:

Code:
<?=anchor('comments/'.$row->id,'reply');?>

When I click it browser redirects to:

mysite.com/comments/1 and 404 Page Not Found

What am I missing?
#2

[eluser]InsiteFX[/eluser]
Code:
<?=anchor('welcome/comments'.$row->id,'reply');?>

controller/method

InsiteFX
#3

[eluser]Unknown[/eluser]
Oh God! That's why there is no similar problem in the whole internet. I knew I was missing something.

Thank you very much!!!




Theme © iAndrew 2016 - Forum software by © MyBB