How to remove controller name from url making it clean in codeigniter

后端 未结 9 1326
余生分开走
余生分开走 2020-12-20 16:50

I have the following url..

http://localhost/ci/site_controller/home

I want to remove site_controller controller

9条回答
  •  梦毁少年i
    2020-12-20 17:18

    I just found the solution in this link, it works for me: http://ellislab.com/forums/viewthread/148531/

    $route['^(page1|page2|page3|page4)(/:any)?$'] = "YOURCONTROLLERNAME/$0";
    

    Hope it helps you :)

提交回复
热议问题