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

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

I have the following url..

http://localhost/ci/site_controller/home

I want to remove site_controller controller

9条回答
  •  不知归路
    2020-12-20 17:22

    assuming you currently have your url http://localhost/ci/site_controller/home you can just write an explicit route like below to your /application/config/routes.php

    $route['ci/home'] = 'site_controller/home';
    

    or

    $route['ci/home'] = 'ci/site_controller/home';
    

    if your controller is namespaced to /application/controllers/ci/

提交回复
热议问题