开发者

Not displaying the controller in the URL

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜