Welcome Guest, Not a member yet? Register   Sign In
Redirect from directory within controllers
#1

[eluser]garethfoote[/eluser]
Hi there,

I am developing my first project in code igniter and am unsure how to get round this problem.

For demonstration purposes my base_url is http://example.com/.

In my controllers directory I have another directory called admin. Below is the structure:
-controllers-(dir)
examplecontroller.php
anothercontroller.php
-admin-(dir)
dashboard.php

At the moment when someone navigates to http://example.com/admin they are taken to the base_url.

I need to put a redirect in the admin directory (redirect to - controller/admin/dashboard) or use built in routing but for some reason in this case routing isn't working. I am using routing elsewhere successfully which is confusing. Essentially I need an index.php type file in the admin directory but not sure how this works.

Any suggestions greatly aprpeciated,

Many thanks,

Gareth
#2

[eluser]pistolPete[/eluser]
What routes are you using at the moment?
I'd use something like this:
Code:
$route['admin'] = 'admin/dashboard';




Theme © iAndrew 2016 - Forum software by © MyBB