Codeigniter 4 Removing Index.Php From Url

Codeigniter 4 Removing Index.Php From Url

Today, we will learn how to remove index.php from URL in Codeigniter 4. why are you remove index.php from URL? because when users using create SEO friendly, user readability and easy to understand for the user.

Now, let’s start to discuss how to remove index.php from URL in Codeigniter 4. so you can follow the below step.

Step 1: Update in the App.php File
In this step, We need to change baseURL, indexPage and uriProtocol in the “config/app.php” file. so you can follow the below changes.

Step 2: Copy index.php and .htaccess files
The second step Copy the “index.php” and “.htaccess” files file in the public directory and paste on root your project directory.

Step 3: Update In the index.php
Finally, after move successfully files on the root directory. The open “index.php” file and change the pathsPath.

Related Posts
Please follow and like us: