Welcome Guest, Not a member yet? Register   Sign In
How do you remove the controller from the URL?
#11

[eluser]learning_php[/eluser]
Hi,

I not to bothered as it a admin panel to update the database. It's in its own controller called admin which returns a 404.

Thanks
#12

[eluser]Dam1an[/eluser]
In which case, the easiest way, assuming you don't have too many functions in the homepage controller would be to do
Code:
$route['a'] = "homepage/a";
$route['b'] = "homepage/b";
$route['c'] = "homepage/c";
$route['d'] = "homepage/d";
The admin controller should then work as normal

Alternativly (the idea just came to mind), you could take advantage of the fact that higher roues have precedence over lower routes, so you could do
Code:
$route['admin/(:any)'] = "admin/$1";
$route['(:any)'] = "homepage/$1";


this way, any URL such as wedding-site/admin/do-something would go to the admin controller, whereas wedding-site/do-something-else would go to the homepage controller
#13

[eluser]learning_php[/eluser]
Thanks it all seems to be working correctly




Theme © iAndrew 2016 - Forum software by © MyBB