Configure CodeIgniter 4 to run directly without the need to put the path to the public folder in the url, example:
http://localhost/ci4login/
And not having to put the full path for it to run.
http://localhost/ci4login/public/
This without the need to delete the public folder, or remove the file index.php
and the file from it .htaccess
and thus be able to maintain all the security.
I use CodeIgniter 3 and I want to migrate to CI4 and this part stops me since the ideal is to use the framework as its use was designed
You would need to add an
.htaccess
additional file in the root folder of your project, outside the folderpublic
(in your case ci4login) with the following:* Change
nombre-proyecto
to the name of your root folder (ci4login)This will override any urls to your project's public folder, you need to have it enabled
mod_rewrite
in your apache server configuration.