简体   繁体   中英

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.

在您的application / config / routes.php文件中,您只需要设置默认控制器即可。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM