This is most likely caused by the fact that you are changing the document root during a request. From the looks of your URL (with the ~user
segment) you are using mod_userdir
or something similar, and what these types of plugins do it allow you to map a given URL prefix to a document root that is not the normal one for the server.
As such, you sometimes run into issues like this where the right .htaccess file is found, but its rewritten URL is against the original document root rather than the modified one and so your index.php
file cannot be found (maybe, to be honest I don't really know, this is all conjecture). This is also why going directly to index.php/users
works - the problem isn't the setup per se, but the mixing of rewrite rules and the change of the document root.
As such, the fix is to use a RewriteBase
line, ad the following to the .htccess file:
RewriteBase /~user/lara/public/