Remove index.php by .htaccess – CodeIgniter

In this tutorial we are going to learn how to remove index.php from URL using .htaccess file in CodeIgniter. .htaccess is the shortened used for Hypertext Access, which is a powerful configuration file that controls the directory “.htaccess”. It is used by Apache based web servers to control various server features.

Step:-1  Open the file config.php located in application/config path.  Find and Replace the below code in config.php file.

Step:-2  Go to your CodeIgniter folder and create .htaccess file at Application folder level. Write below code in .htaccess file.


Step:-3  In some cases the default setting for uri_protocol does not work properly. To solve this issue just open the file config.php located in application/config and then find and replace the code as:

 

Was this post helpful?
Let us know if you liked the post. That’s the only way we can improve.
Yes0
No0
Harinder Singh

Harinder Singh

My name is Harinder Singh and I specialize in Software industry. I consider myself as a life learner. I love learning new concepts, embracing new ideas and reading and searching for innovation.