Codeigniter 4 Remove Public and Index.php From URL (Ok)
Last updated
Was this helpful?
Last updated
Was this helpful?
February 5, 2020 By Tuts Make 1 Commenton Codeigniter 4 Remove Public and Index.php From URL
If you want to remove public and index.php from URL in Codeigniter 4 framework. So this tutorial will help you.
In this tutorial, we would love to share with you, how to remove public and index.php from URLs in the new Codeigniter 4 frameworks.
The directory structure of the New Codeigniter 4 framework has been changed.
Follow the below-given steps and easily remove the public and index.php from URL in Codeigniter 4 framework:
The first step is to open the app.app file. And the changes mentioned below. You have to do this in your App.php file.
So go to project_name/app/Config/App.php and change mention below:
And the second change in the app.php file:
In public/ directory, copy index.php and .htaccess to your root project directory.
In the root project directory, open index.php and edit the following line:
In this tutorial, you have learned how to remove the public and index.php in new Codeigniter 4 framework.
Now you can hit the below url in your browser.
Categories: Codeigniter