How do I hide the Controller name in the url?

Asked

Viewed 167 times

1

I would like to know how to hide the controller’s name in Codeigniter.

Knowing that codeigniter works as follows:

www.meusite.com/CONTROLADOR/FUNÇÃO

Ex: www.meusite.com/dashboard/login I want you to stay www.meusite.com/login

Thank you in advance!

1 answer

4

You can use the routes In the archive application/config/Routes.php

Has an array called '$route' where you can define your routes

$route['product/:num'] = 'catalog/product_lookup'; 

In your case I think I’d stay

$route['login'] = 'dashboard/login';
  • Could you tell me what the code line of my example would look like?

  • edited the answer

Browser other questions tagged

You are not signed in. Login or sign up in order to post.