To deploy the application securely
1. All application and system source code to be placed not in public_html directory

public_html should contain index.php, assets with css and js files and .htaccces that should look like this if you want to get rid of the index.php thing in the routing)
2. Modify .htaccess file
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
3. Update config files such as config.php, database.php and routes.php
4. Modify index.php set
$system_path = '../system';$application_folder = '../application'