Welcome Guest, Not a member yet? Register   Sign In
Why CI4 Cannot Run in a Subdirectory?
#3

If you access your app as xxx/myapp/public, then you are unnecessarily exposing the other folders in your app, eg. xxx/myapp/writable, unless you take care to configure things properly, eg with .htaccess files everywhere.

If you want to access your app as xxx/myapp, you might get away with a symbolic link of WEBROOT/myapp to WHEREVER_IT_REALLY_IS/public, but that is more work for you.

A better practice is to use subdomains, eg staging.xxx.com, rather than xxx.com/staging/public.

Another argument for mapping an app to a subdomain is for asset references. With a subdomain, '/images/abc.jpg' refers to the "images" folder inside your "public". With a directory mapping, then 'images/abc.jpg' would refer to 'public/images/abc.jpg' for the URL '', but to 'public/index.php/images/abc.jpg' if you aren't stripping index.php. It gets worse if you are using URI segments to pass parameters.

How does this differ from Laravel (or any of the other major frameworks)? I am curious Smile
Reply


Messages In This Thread
RE: Why CI4 Cannot Run in a Subdirectory? - by ciadmin - 12-25-2018, 09:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB