Welcome Guest, Not a member yet? Register   Sign In
Routing question
#1

Hi.

I have created a sub-directory under application/controllers/  called "Admin". In there I created a controller called "Admin.php"

Similarly in views I created a subdirectory called "admin"

In routes I added this line: 


PHP Code:
$route['admin'] = "admin/admin"

Now I can access my admin folder by going to mysite.com/admin/

Then I created a new controller called "Controllers/Admin/Settings.php" and a view file called "admin/settings.php"

I'd like to access it by going to mysite.com/admin/settings but I get a 404 error. I tried every variation in route I could think of, but I can't figure it out.

Thanks for any help.
Reply
#2

Do you have more rewrite rules? Because that's the only thing you need under CI 3.1.9.
Are your functions named index() inside your Settings.php/Admin.php?
Reply
#3

Oh, thanks. I didn't name the function "index".
Reply




Theme © iAndrew 2016 - Forum software by © MyBB