Welcome Guest, Not a member yet? Register   Sign In
How to remove public/index.php from the URL
#7

(12-22-2020, 07:54 AM)t_5810 Wrote: And I have to find a solution that will work on all hosts, since I use CodeIgniter in all my projects, so I need to find a way around this obstacle, which will not compromise the security of the website - app.

Needles to say, exactly the fact that that all files should be outside of the root folder significantly increases the security, but how to find a solution that will work on all hosts is the question of 1 million $...

It's better to have most of the code outside the root folder, but if your host gives you no other choice, I'm sure you can make it work with everything in your public folder. Before CI4, a lot of people didn't bothered to move the application and system folders outside the root. You'll have to edit index.php so it can find your app folder: 

PHP Code:
<?php
// Location of the Paths config file.
// This is the line that might need to be changed, depending on your folder structure.
$pathsPath realpath(FCPATH '../app/Config/Paths.php');
// ^^^ Change this if you move your application folder 
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply


Messages In This Thread
RE: How to remove public/index.php from the URL - by includebeer - 12-22-2020, 05:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB