404 Page Not Found

#1
[eluser]spagi[/eluser]
Hi,i have downloaded a new version 1.7.1 and I am build controller
Code:
<?php
class About extends Controller {
    
      
    
    function index() {
      $data['title']="";
      $this->load->view('pridej_view', $data);
    
    }
   function photo() {
      $data['title']="Photo";
      $this->load->view('photo_view', $data);
}
}


?>
$route['default_controller'] = "about";
and if I am calling /about/ is everythig OK
but if I am calling /about/photos/
I get an error 404 Page Not Found
Can anybody help?

PS: If I had older version I had no problem with this.

#2
[eluser]pistolPete[/eluser]
Quote:but if I am calling /about/photos/

The function in your controller is called photo (singular), so you should call /about/photo.
Does that solve your problem?

#3
[eluser]spagi[/eluser]
No The S was typing error
And a get same error if I am calling other (no default) controller

#4
[eluser]pistolPete[/eluser]
Is the "404 Page Not Found" a CodeIgniter error one or is it sent by the webserver?
Did you setup any other routes than the default controller?
Do you use a .htacess file?

Try the different settings of
Code:
$config['uri_protocol'] = ?

#5
[eluser]spagi[/eluser]
It is sent by server,
$config['base_url'] = "http://www.jiripasz.wz.cz/";
$config['uri_protocol'] ="REQUEST_URI"; I had "AUTO"

Yes I am using .htacess file, but if i am deleting this file, i get the same error.

#6
[eluser]jedd[/eluser]
And if you change your photo method to call the pridej_view?

#7
[eluser]spagi[/eluser]
I'm not sure what you mean. Sad

#8
[eluser]jedd[/eluser]
This is your original code:

Code:
class About extends Controller {
    
    function index() {
      $data['title']="";
      $this->load->view('pridej_view', $data);
    }

   function photo() {
      $data['title']="Photo";
      $this->load->view('photo_view', $data);
}
}




I'm asking what happens if you change it to this:

Code:
class About extends Controller {
    
    function index() {
      $data['title']="";
      $this->load->view('pridej_view', $data);
    }

   function photo() {
      $data['title']="Photo";
      $this->load->view('pridej_view', $data);      // <----- Yes, this line right here.
}
}

#9
[eluser]spagi[/eluser]
Hmm it is same ... error 404
And if I change the default_controller from $route[‘default_controller’] = “about”; to $route[‘default_controller’] = “/about/photo/”;
The photo_view is showing correctly, but like default controler

#10
[eluser]vickel[/eluser]
maybe this helps:

Code:
class Whatever extends Controller {
            
    function Whatever ()
    {
        parent::Controller();    
                $data['a']="anything";
                $this->load->view('header', $data);
        
    }
    
    function index()
    {
                $data['s']="something";
                $this->load->view('body', $data);
        }

If you intend to use a constructor in any of your Controllers, you MUST place the following line of code in it:parent::Controller();

hope this helps

P.S: i found this @ http://ellislab.com/codeigniter/user-gui...llers.html


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.