如何删除索引段在我的编码器url



我正在使用phil sturgeon的rest控制器api,这是url paycent/user/索引/id/1 。提前感谢!

你需要为它设置路由

应用程序/config/routes.php文件

中设置路由
$route['paycent/user/id/(:any)'] = 'paycent/user/index/id/$1';

注意:如果paycent是你的项目名称,请从你的路由中删除它。要创建链接,你只需要写<?php echo site_url('paycent/user/id/1'); ?>。它将重定向到index方法。

In application/config/config.php:

改变
$config['index_page'] = 'index.php'; 

$config['index_page'] = ''; 

最新更新