• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weird 404 Error

#1
[eluser]Unknown[/eluser]
I have a controller called 'products' and when I access this controller I get a 404 error. I also have controllers like 'categories' which work and have the same structure:

For example here is the code from application/controllers/products.php:
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Products extends Controller{
    function __construct(){
                parent::Controller()
        }
        function index(){
          echo 'The output';
        }
}

When I have this url: http://www.site.com/products/ it shows 404 , but when I have http://www.site.com/index.php/products/ I can see 'The output' at the same time http://www.site.com/categories/ work.

The logs I get are like this:

DEBUG - 2008-08-04 13:18:25 --> Hooks Class Initialized
DEBUG - 2008-08-04 13:18:25 --> URI Class Initialized
ERROR - 2008-08-04 13:18:25 --> 404 Page Not Found -->

//later

Solved. The problem was a file located in the root CI folder. It was called products.csv so this is why it didn't work. This is probably due to +MultiViews. Anyway.. still a weird behavior.

#2
[eluser]Derek Allard[/eluser]
Glad you got it Alexandu! Welcome to CodeIgniter.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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