Skip to content
  • Github
  • Facebook
  • twitter
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms & Conditions
  • Site Map

XpertPhp

Expertphp Is The Best Tutorial For Beginners

  • Home
  • Javascript
    • Jquery
    • React JS
    • Angularjs
    • Angular
    • Nodejs
  • Codeigniter
  • Laravel
  • Contact Us
  • About Us
  • Live Demos
how to remove index.php from URL in Codeigniter, CodeIgniter removing index.php from URL. remove index.php from Codeigniter

How to Remove index.php from URL in Codeigniter 3

Posted on December 1, 2019December 17, 2022 By XpertPhp 19 Comments on How to Remove index.php from URL in Codeigniter 3

Today, we will explain to you how to remove index.php from URL in Codeigniter 3. in this article, we will give you a simple example of how to remove index.php from url in codeigniter. so you can easily remove the index.php from url.

why need to remove index.php from URL? because when users use it to create SEO friendly, user readability and easy to understand the user.

Now, let’s start to discuss how to remove index.php from the URL in Codeigniter.

 

Step 1: Updating Config file
in this step, we need to update the below configuration setting in the “application/config/config.php” directory.

PHP
1
2
3
4
//old Code
$config['index_page'] = "index.php”
//New updated
$config['index_page'] = ""

Step 2: Apache setting

In this step, we need to check “mod_rewrite” is enabled or not. if it’s not enabled then we need to enable “mod_rewrite”. after enabling then restart the apache server. if it’s enabled then we no need to do anything.
why should enable the “mod_rewrite” module because it gives permission for httacess rewrite,

Step 3: Creating .httacess file

In this step, we need to create a .htaccess file on the root directory and paste the below code into this file.

PHP
1
2
3
4
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

See also  How to create Pagination in Codeigniter and MySql
Codeigniter Tags:codeigniter tutorial, codeigniter url htaccess, codeigniter url rewrite

Post navigation

Previous Post: Laravel 6 In Get Current URL with Parameters
Next Post: How to Install MariaDB on Ubuntu 18.04

Latest Posts

  • Laravel 12 Ajax CRUD Example
  • Laravel 12 CRUD Example Tutorial
  • How to Create Dummy Data in Laravel 11
  • Laravel 11 Yajra Datatables Example
  • Laravel 11 Ajax CRUD Example
  • Laravel 11 CRUD Example Tutorial
  • Laravel 10 Ajax CRUD Example Tutorial
  • Laravel 10 CRUD Example Tutorial
  • How to disable button in React js
  • JavaScript Interview Questions and Answers

Tools

  • Compound Interest Calculator
  • Hex to RGB Color Converter
  • Pinterest Video Downloader
  • Birthday Calculator
  • Convert JSON to PHP Array Online
  • JavaScript Minifier
  • CSS Beautifier
  • CSS Minifier
  • JSON Beautifier
  • JSON Minifier

Categories

  • Ajax
  • Angular
  • Angularjs
  • Bootstrap
  • Codeigniter
  • Css
  • Htaccess
  • Interview
  • Javascript
  • Jquery
  • Laravel
  • MongoDB
  • MySql
  • Nodejs
  • Php
  • React JS
  • Shopify Api
  • Ubuntu

Tags

angular 10 tutorial angular 11 ci tutorial codeigniter 4 image upload Codeigniter 4 Tutorial codeigniter tutorial CodeIgniter tutorial for beginners codeigniter with mysql crud operation eloquent relationships file upload File Validation form validation Image Upload jQuery Ajax Form Handling jquery tutorial laravel 6 Laravel 6 Eloquent Laravel 6 Model laravel 6 relationship laravel 6 relationship eloquent Laravel 6 Routing laravel 7 Laravel 7 Eloquent laravel 7 routing laravel 7 tutorial Laravel 8 laravel 8 example laravel 8 tutorial laravel 9 example laravel 9 tutorial Laravel Framework laravel from scratch laravel social login learn jquery nodejs pagination payment gateway php with mysql react js example react js tutorial send mail validation wysiwyg editor wysiwyg html editor

Copyright © 2018 - 2025,

All Rights Reserved Powered by XpertPhp.com