Welcome Guest, Not a member yet? Register   Sign In
URI Ruting rule(s) for sub directorie(s) / folder(s)
#1

[eluser]$@!ful[/eluser]
Directory structure of my controllers directory is:

Code:
-controllers
    -classic
        -visitor
            -home.php
        -admin
            -home.php
        -user
            -home.php
        -home.php
    -mobile
        -visitor
            -home.php
        -admin
            -home.php
        -user
            -home.php
        -home.php
    -home.php

My routing configuration settings are:

Code:
$route['default_controller'] = "classic/home";

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

So when I browse:
sitename/ then it loads controllers/home.php
and when I browse sitename/classic then it lodes controllers/classic/home.php
but when I browse sitename/classic/visitor it generates a 404 error

Please help me to solve this problem.
#2

[eluser]Michael Wales[/eluser]
Controllers may only be one folder level deep within the /controllers directory.
#3

[eluser]$@!ful[/eluser]
[quote author="Michael Wales" date="1230763829"]Controllers may only be one folder level deep within the /controllers directory.[/quote]

Please give me any idea so that I can implement my above directory structure within one folder level deep.
#4

[eluser]Adam Griffiths[/eluser]
Go look in the routes library, find out where it looks in a sub-directory and change as needed.

Of course, create a My_Router library in your libraries/ folder and properly extend the CI_Router library. Smile




Theme © iAndrew 2016 - Forum software by © MyBB