Question : how to remove public from url in codeigniter 4
Answered by : rohit-ghodadra
// codeigniter-4
----------------------------------- Step 1: Change in App.php File
----------------------------------- public $baseURL = 'http://localhost:8080'; To public $baseURL = 'http://localhost/your_project_name/'; * And the second change in the app.php file: public $uriProtocol = 'REQUEST_URI'; To public $uriProtocol = 'PATH_INFO';
-------------------------------------- Step 2: Copy index.php and .htaccess
--------------------------------------
--> Visit inside public directory. And copy index.php and .htaccess to codeigniter app root directory.
------------------------------ Step 3: Change In index.php
------------------------------ $pathsPath = FCPATH . '../app/Config/Paths.php'; change TO $pathsPath = FCPATH . 'app/Config/Paths.php';
Source : | Last Update : Mon, 04 Apr 22
Question : Remove public from the url in the codeigniter
Answered by : energetic-echidna-25xkuyxsn5vu
$pathsPath = realpath(FCPATH . '../app/Config/Paths.php');
replace by
$pathsPath = realpath(FCPATH . '../app/Config/Paths.php');
Source : https://techtechinfo.com/how-to-install-codeigniter-4-php-framework/ | Last Update : Sat, 15 Jan 22