Marvin Calderon
Marvin Calderon

Reputation: 21

How to remove controller and function name from base url in Codeigniter

Im having this issue:

I have a URL for example:

http://www.example.com/home

in which 'home' is the name of the controller calling his index function. Everything works fine in here but I want to call that home controller but only showing base url like this:

http://www.example.com

Anyone knows how to do this? Setting routes like this:

$routes[''] = 'Home';

It doesn't work for me.

Thanks in advance for any information.

Upvotes: 0

Views: 409

Answers (1)

TimBrownlaw
TimBrownlaw

Reputation: 5507

In your application/config/routes.php you just need to set the default controller...

$route['default_controller'] = 'home';

Upvotes: 2

Related Questions