Answers for "how to remove public from url in codeigniter 4"

1

how to remove public from url in codeigniter 4

// 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';
Posted by: Guest on March-28-2022
1

Remove public from the url in the codeigniter

$pathsPath = realpath(FCPATH . '../app/Config/Paths.php');
replace by
$pathsPath = realpath(FCPATH . '../app/Config/Paths.php');
Posted by: Guest on January-08-2022

Code answers related to "how to remove public from url in codeigniter 4"

Browse Popular Code Answers by Language