• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do you remove the controller from the URL?


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.


In which case, the easiest way, assuming you don't have too many functions in the homepage controller would be to do
$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
$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

Thanks it all seems to be working correctly

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.