Welcome Guest, Not a member yet? Register   Sign In
Weird 'admin' error
#1

[eluser]fauria81[/eluser]
Hi everybody!

Im having a trouble that i find quite weird. Maybe is a very simple mistake, but i cant figure it out.

Im doing a website using Codeigniter 1.7.1, and i need a controller for the backend.

Everything is working fine, until i create a controller named 'admin.php':

Code:
<?php
class Admin extends Controller {
       function Admin(){
            parent::Controller();
       }      
       function index(){
          ...
       }
}
?>

when i piont my browser at http://localhost/codeigniter/admin, i get:

404 Page Not Found. The page you requested was not found.

The thing is that if i change the filename to 'backend.php', and 'class Backend ... function Backend ...' it works as expected (using localhost/backend).

It sounds like a conflict between something and a controller named 'admin'.

Any ideas on this?

Thank you!
#2

[eluser]Pascal Kriete[/eluser]
Shouldn't be any conflicts there. Sounds like it might be a potential htaccess problem.

Is it a server 404 or CI 404?
#3

[eluser]Dam1an[/eluser]
Do you have an admin folder in the controller directory as wel as a file called admin.php?
#4

[eluser]fauria81[/eluser]
Hi!

It is a Codeigniter error, the error.log from apache does nor register anything.

My .htaccess is as follows (copied from Codeigniter documentation):
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /codeigniter
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

Thank you!
#5

[eluser]fauria81[/eluser]
Hi!,

No, i have no 'admin' folders, just a controller named admin.php and a folder named backend/ .
#6

[eluser]fauria81[/eluser]
Sorry guys, it was the routes.php file that was messed up.

Thanks for the replys!




Theme © iAndrew 2016 - Forum software by © MyBB