在哪里定义codeigniters重写规则来识别控制器,方法,段中的id?

how codignitetr recognzes controllername,methodname,id from url like:

https://stackoverflow.com/controllername/methodname/id

The most used method for this is CI_URI->segments();

Read more here: https://www.codeigniter.com/userguide3/libraries/uri.html#CI_URI::segment

So, each / after your host be different segment.

For example:

//http://stackoverflow.com/controllername/methodname/id
echo $this->uri->segment(1); // controllername
echo $this->uri->segment(2); // methodname
echo $this->uri->segment(3); // id