开发者

Not displaying the controller in the URL

开发者 https://www.devze.com 2023-01-18 18:10 出处:网络
How can you hide the controller in the URL?When a non-registered user comes to my website, I would like them to see:

How can you hide the controller in the URL? When a non-registered user comes to my website, I would like them to see:

http://www.site.com/

O开发者_Python百科nce they log-in, then they would be directed to the "Home" controller, then appearing as normal (i.e. http://www.site.com/home)

Any suggestions?


You can set the 'Home' controller as default, by using CodeIgniter's routing feature.

To set a default controller, open 'application/config/routes.php', and set:

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

CodeIgniter - Setting a default controller

CodeIgniter - URI Routing

0

精彩评论

暂无评论...
验证码 换一张
取 消