1
我使用HMVC和Codeigniter-3.x,使用MX作为后端和前端。整个项目都在一个子域中。 前端在localhost和在线域名都能正常工作。 在本地主机后端也运行良好。 但后端不在在线域上工作。 链接从模块404使用MX的HMVC和使用MX的Codeigniter无法在子域中工作
我已经用于定义基本URL作为
$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
$config['base_url'] .= "://".$_SERVER['HTTP_HOST'];
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
是否有HMVC装载机任何路由溶液? 我的项目结构在这里。
mydomain.com
/subdomain
/system
/asset
/application
/controllers
/models
/views
/modules
/module_1
/controllers
/models
/views
/third_party
/MX
/core
/helper
/config
/....
/backend
/asset
/application
/controllers
/models
/views
/modules
/module_1
/controllers
/models
/views
/third_party
/MX
/core
/helper
/config
/....
尝试从'base_url'设置中删除'SCRIPT_NAME'行,同时在'HTTP_HOST'之后设置尾部斜杠。 – Tpojka
这也不起作用。即使我使用静态base_url像$ config ['base_url'] =“https://example.com/subdomain/backend”;为我的后端项目。同样的麻烦。 –
'base_url'也需要方案(即'http:// example.com')。 – Tpojka