Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] controller in subfolder and index.php
#1

[eluser]bibos[/eluser]
Hi,

i'm in CodeIgniter2.1.0.

I have a controller subfolder like :

+controllers
|-+admin
|->admin.php

next i folow the steps to remove the 'index.php' from URI but when i try to reach :

http://localhost/admin/admin/index

a '404 not found' error is shown!

this is my htaccess :

Code:
RewriteEngine On
RewriteCond $1 !^(index\.php|farkess_public|farkess_core|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

can some one help please?

THKS

#2

[eluser]InsiteFX[/eluser]
.application/config/routes.php
Code:
// Admin Controller
// ------------------------------------------------------------------------
$route['admin/admin/(:any)'] = 'admin/admin/$1';
$route['admin'] = 'admin/admin';
#3

[eluser]Bhashkar Yadav[/eluser]
also, make a update into config file (located at /application/config/) with
Code:
$config['index_page'] = '';
#4

[eluser]bibos[/eluser]
HI,

Same problem with your solution, i still have '404' error!!

SO i have this situation :

in 'located at /application/config/' i have :

Code:
...
$config['index_page'] = '';  
...

in 'application/config/routes.php' i have :

Code:
...
$route['default_controller'] = "farkess/farkess";
$route['404_override'] = '';

$route['admin/admin/(:any)'] = 'admin/admin/$1';
$route['admin'] = 'admin/admin';

...

my htaccess stil the same as above :

Code:
RewriteEngine On
RewriteCond $1 !^(index\.php|farkess_public|farkess_core|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

still have :

Code:
The requested URL /admin/admin/login was not found on this server.

but when i use this uri:

Code:
http://farkess.farkess.com/index.php/admin/admin/login

it's work!!!!!

is this a bug? or i do some thing wrong?

THKS
#5

[eluser]bibos[/eluser]
SOLVED!!

I do a mistakes Sad i forgot the '.' dot of htaccess file !

Sorry Smile
#6

[eluser]InsiteFX[/eluser]
No problem it can happen to anyone, the thing is to remember and correct our mistakes so that we do not make them again.
#7

[eluser]Mauricio de Abreu Antunes[/eluser]
[quote author="InsiteFX" date="1329300760"]No problem it can happen to anyone, the thing is to remember and correct our mistakes so that we do not make them again.
[/quote]

Sure!

I would use another name for my controller.
admin/home

My app shows this page when you are logged in:

portal/home

home.php is my controller into portal folder.




Theme © iAndrew 2016 - Forum software by © MyBB