Multile domain pointed to a signle application - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Multile domain pointed to a signle application (/showthread.php?tid=84606) |
Multile domain pointed to a signle application - SubrataJ - 10-26-2022 I have an application with 3 modules as follows-
from domain 1 user can access the client module only and from domain 2 user can access only Admin and Provider modules. is there any way we can segregate and target modules as per domain? RE: Multile domain pointed to a signle application - SubrataJ - 10-26-2022 (10-26-2022, 01:22 AM)SubrataJ Wrote: I have an application with 3 modules as follows- This is what I have done so far and working. Inside app/Config/Constants.php PHP Code: $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https://' . $_SERVER['HTTP_HOST'] . '/' : 'http://' . $_SERVER['HTTP_HOST'] . '/'; and then created a filter PHP Code: public function before(RequestInterface $request, $arguments = null) after that I have applied it inside routes.php PHP Code: $routes->group('client', ['namespace' => 'ClientDashboard\Controllers', 'filter' => 'client-domain'], function ($routes) { to be honest, I have no idea if this is the convenient way to do this or not, but for now, it's working as I wanted. RE: Multile domain pointed to a signle application - kenjis - 10-26-2022 Validate the $_SERVER['HTTP_HOST']. Otherwise you'll make vulnerability. |