Codeigniter folder structure on web server

I want to upload a code igniter folder to a remote server. Should I upload the codeigniter root folder to my public_html folder to get the following structure

public_html/ codeigniter/ application/ system/ .... 

or should I download the application system ... directly to my public_html , and if I upload to the codeigniter folder, can I point somewhere in the config to my codeigniter library so that my links are left without /codeigniter/

+6
source share
4 answers

better to do so:

 application/ system/ public_html/ index.php 

for security reasons, put your application and system folder outside of your public_html

+8
source

This will depend on the apache configuration on your server.

From my POV, it is better to have a structure like:

 public_html/ codeigniter/ application/ system/ [...]/ 

Then make your apache configuration item in this folder with something like:

 <VirtualHost *:80> DocumentRoot "path_to_the_folder/codeigniter" ServerName yourDomain.loc ServerAlias www.yourDomain.loc <Directory path_to_the_folder/codeigniter/ > #Your options </Directory> </VirtualHost> 

and your /etc/hosts file looks like this:

 127.0.0.1 yourDomain.loc 127.0.0.1 www.yourDomain.loc 
+2
source

Create a user guide

To ensure maximum security, the system and any application folders should be placed above the web root so that they are not directly accessible through the browser.

So, my setup is to create a custom public directory in the code base of the code and in index.php .

And copy .htaccess and index.html from either the system or application folder to the codebase to deny access to the database.

enter image description here

+2
source

Usually you download everything under / codeigniter. This way you will have a directory structure, for example:

 - public_html - images - js - system - application - other codeigniter folders 
-2
source

Source: https://habr.com/ru/post/945412/


All Articles