I have some controllers like home and welcome , now in my routes.php i have set the default controller to be:
$route['default_controller'] = 'home/index';
This works fine, now I want for all other controller to go to the default function of index without typing index in the url like.
http://localhost/codeigniterapp/index.php/welcome/
To do that I did this in the routes.php:
$route['welcome'] = "welcome/index";
$route['home'] = "home/index";
$route['xxx'] = "xxx/index";
Now I don't want to be doing that for every controller but would want something like a (:any) wildcart i saw in their userguide . I tried:
$route['(:any)'] = '(:any)/index';
But that did not work.
查看删除index.php文件https://www.codeigniter.com/userguide3/general/urls.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.