Codeigniter removing index.php from url – onlinecode
In this post we will give you information about Codeigniter removing index.php from url – onlinecode. Hear we will give you detail about Codeigniter removing index.php from url – onlinecodeAnd how to use it also give you demo for it if it is necessary.
Today, we will learn how to remove index.php from URL in Codeigniter. why are you remove index.php from URL? because when user 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.
Apache setting.
First, we will enable the “mod_rewrite” on apache server. because it gives permission of httacess rewrite, for that we need to enable “mod_rewrite”. after enable then restart the apache server.
Updating Config file
After then we will update the below configuration setting in the “application/config/config.php” directory.
$config['index_page'] = ""; $config['uri_protocol'] = "REQUEST_URI";
Creating httacess file
Finally, we will create htaccess file and paste the below code in this file and that file put on the root directory project.
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule>
Hope this code and post will helped you for implement Codeigniter removing index.php from url – onlinecode. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs