开发者

Routing all URL requests in CodeIgniter?

开发者 https://www.devze.com 2023-02-07 01:30 出处:网络
Is there a way to capture all URL requests and route them? Sort of like:开发者_开发知识库 $route[\'everything\'] = \"controller\";

Is there a way to capture all URL requests and route them? Sort of like:

开发者_开发知识库
$route['everything'] = "controller";


$route['(:any)'] = "controller";


$route['(:any)'] = "your_controller/your_method/$1";

This should work. This way, what is in (:any) will be passed to your method as a parameter.


Try this -

$route[':any'] = 'path of the default controller';

you can get it's documentation here

0

精彩评论

暂无评论...
验证码 换一张
取 消