Hiding or removing controller name in url using routes for seo purpose = codeigniter

前端 未结 2 1551
盖世英雄少女心
盖世英雄少女心 2021-01-23 10:48

I am using one controller. How can I remove or hide the controller name on my URL using routes? I already set my .htaccess to remove my index.php. I\'ve tried lots of code from

2条回答
  •  無奈伤痛
    2021-01-23 11:07

    You can define a custom route in config/routes.php - for example:

    $route['about'] = 'name_controller/about';
    

    Then, http://example.com/about goes to http://example.com/name_controller/about

    See more http://ellislab.com/codeigniter/user-guide/general/routing.html

提交回复
热议问题