Codeigniter subdomain routing

前端 未结 4 705
时光取名叫无心
时光取名叫无心 2021-02-01 08:10

I\'m trying to setup a blog script on a website running on the CodeIgniter framework. I want do this without making any major code changes to my existing website\'s code. I figu

4条回答
  •  无人及你
    2021-02-01 08:50

    $route['latest'] = "index";
    

    means that the URL http://blog.example.com/latest will look for an index() method in an index controller.

    You want

    $route['latest'] = "blog/latest"; 
    

    Codeigniter user guide has a clear explanation about routes here

提交回复
热议问题