Welcome Guest, Not a member yet? Register   Sign In
404 Not Found - sure it's simple but can't figure it out
#1

[eluser]gypmaster[/eluser]
Hi,

CI Newb and trying to follow a book on developing CI applications. Going ok except I keep getting a 404 Not Found Error, specifically:

The requested URL /ci/welcome/cat/7 was not found on this server.

when trying to access a function called 'cat' in the welcome controller.
I have a link from the 'home' page to the /ci/welcome/cat/7 url .. the link looks fine and should work. I have a controllers called cat in the welcome controller - here's some of the code in the controller.
Code:
<?php

class Welcome extends Controller {

    function Welcome()
    {
        parent::Controller();    
    }
    
  function index()
      {    
        $data['title'] = "Welcome to Claudia's Kids";
        $data['navlist'] = $this->MCats->getCategoriesNav();
        $data['mainf'] = $this->MProducts->getMainFeature();
        $skip = $data['mainf']['id'];
        $data['sidef'] = $this->MProducts->getRandomProducts(3,$skip);
        $data['main'] = 'home';
        $this->load->vars($data);
        $this->load->view('template');
      }
      
  function cat($id)
    {
        $cat = $this->MCats->getCategory($id);
        if (!count($cat))
            {
                redirect('welcome/index','refresh');
            }
        if ($cat['parentid'] < 1)
            {
                //show other categories
                $data['listing'] = $this->MCats->getSubCategories($id);
                $data['level'] = 1;
            }
        else
            {
                //show products
                $data['listing'] = $this->MProducts->getProductsByCategory($id);
                $data['level'] = 2;
            }
        $data['title'] = "Claudia's Kids | ". $cat['name'];
        $data['navlist'] = $this->MCats->getCategoriesNav();
        $data['category'] = $cat;
        $data['main'] = 'category';
        $this->load->vars($data);
        $this->load->view('template');
    }
I have set the default controller to 'welcome'.

Here's my .htaccess:

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|captcha|css|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

anyone help with this?
TIA


Messages In This Thread
404 Not Found - sure it's simple but can't figure it out - by El Forum - 08-05-2009, 11:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB