Usually, in the CodeIgniter 4 project, you will see there is an additional argument in the URL. That is index.php in your project URL. So, if you don’t want this extra parameter then you can remove it. This will make a clean URL of your website. There are several ways to remove this index.php in CodeIgniter 4. You can create a .htaccess file and create the rule to override the URL. It will require the host to access the created .htaccess file. So, it depends upon the host like Apache or Nginx. In my last tutorial, I have shared the post on  CodeIgniter 4 Multiple Image Upload. If you followed that then you have the idea of redirection of the URL with index.php after image upload. In this post, I am not going to create a new project in CodeIgniter 4 for this. I will be using an existing project here.

Contents

  • 1 Prerequisites
  • 2 How to Check index.php in URL
  • 3 Remove index.php in CodeIgniter 4
  • 4 Conclusion
  • 4.1 Share this:
  • 4.2 Like this:
  • 4.3 Related

Prerequisites

  • To remove the index.php in CodeIgniter 4, you must have an installed project. You can create a new one if you don’t have.

I am not going to show you to create a project in CodeIgniter 4 here.

#codeigniter 4 #php

How to Remove index.php From URL in CodeIgniter 4
1.85 GEEK