1 | initial version |
To set the public folder as the root in CodeIgniter's .htaccess file, follow these steps:
Move all the contents of your application folder to the public folder, except the index.php file and the .htaccess file.
Open the .htaccess file in the application folder and delete all the content.
Open the .htaccess file in the public folder and add the following code:
RewriteEngine On
RewriteRule ^(.*)$ index.php/$1 [L]
This code will redirect all requests to the index.php file in the public folder.
$application_folder = '../application';
$system_path = '../system';
Now, when you access your website, the public folder will be the root directory, and CodeIgniter will handle all requests through the index.php file in the public folder.