gpt4 book ai didi

php - routes.php 中的 Codeigniter URL 问题

转载 作者:搜寻专家 更新时间:2023-10-31 21:50:16 26 4
gpt4 key购买 nike

在我的应用程序中,前端是 MVC,后端是 HMVC。我在后端 url 中遇到问题。我在 routes.php 中定义了我所有的前端 url。(不是后端)

像这样

$route['(.+)/(.+)/(.+)'] = "homes/abc/$1";

但这会影响我的后端工作(案例 3 参数传递)

任何解决方案

最佳答案

尝试在之前添加管理 url 的路由

$route['(.+)/(.+)/(.+)'] = "homes/abc/$1";

喜欢

$route['admin/(:any)'] = 'admin/index/$1';
$route['(.+)/(.+)/(.+)'] = "homes/abc/$1";

或者如果你想做一些 hack 那么:

if(strpos($_SERVER["REQUEST_URI"],'admin/') === false){
$route['(.+)/(.+)/(.+)'] = "homes/abc/$1";
}

关于php - routes.php 中的 Codeigniter URL 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45454624/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com