Close

🔰 PHP Programming Tutorial 8 - Remove index.php from URL in CodeIgniter 4 🔰


How to remove index.php from URL in Codeigniter 4

  1. Update in the App.php File

    We need to change baseURL, indexPage and uriProtocol in the /app/Config/App.php file. You can refer the below changes.

    Then After
    public $baseURL = 'http://localhost:8080'; public $baseURL = 'http://localhost/your_project/';
    public $indexPage = 'index.php'; public $indexPage = '';
    public $uriProtocol = 'REQUEST_URI'; public $uriProtocol = 'PATH_INFO';
  2. Copy index.php and .htaccess files

    Copy the index.php and .htaccess files file from the public directory and paste on root your project directory.

  3. Update In the index.php

    Open index.php file and change the pathsPath.

    Then After
    $pathsPath = FCPATH . '../app/Config/Paths.php'; $pathsPath = FCPATH . 'app/Config/Paths.php';


😉Subscribe and like for more videos:
https://www.youtube.com/@chiragstutorial
💛Don't forget to, 💘Follow, 💝Like, 💖Share 💙&, Comment

0 Comments
Leave a message

 

Search Current Affairs by date
Other Category List

Cookies Consent

We use cookies to enhance your browsing experience and analyze our traffic. By clicking "Accept All", you consent to our use of cookies. Cookies Policy