Welcome Guest, Not a member yet? Register   Sign In
403 in Controller Subdirectory access

I'm not sure if this actually matters (CI might fix it internally), but according to docs CI routes use backslashes (\) to delineate namespaces and forward slashes (/) to delineate the trailing function/argument list. So
$routes->add("admin", "Admin/Login::index");

should be 

$routes->add("admin", "Admin\Login::index");

Again I don't know if this would actually cause you a problem. I think the real issue is this specific line creates a route for a file called admin, not the directory itself. I think to work properly that route would need an additional forward slash:

$routes->add("admin/", "Admin\Login::index");

This is one level shallower than yours but these routes from an example machine do basically the same thing:

$routes->get('/', 'Home::index');
$routes->get('login', 'Login::index');
$routes->get('eula', 'Login::eula');
$routes->get('overview', 'Overview::index');

Any requests to <baseURL> or <baseURL>/ are served by CI's 'default' Controller, <baseURL>/login by the Login controller, etc. 

The other thing I'll say is that with 403 errors, you should pretty much go straight to whatever is hosting the application itself, e.g. Apache, Nginx, etc. Look through those access/error logs for a relevant message, it could be something not directly related to CI, like bad file ownership or permissions.

Messages In This Thread
RE: 403 in Controller Subdirectory access - by schertt - 06-24-2020, 10:15 AM

Theme © iAndrew 2016 - Forum software by © MyBB