Rabu, 07 Februari 2018

how to remove index.php in codeigniter


What codeigniter?

codeigniter is a web framework that allows you to build websites quickly and easily, and in this article I will unite its way, untukk cara instal codeigniter anda bisa baca disini

because in this article I will just blend to remove index.php in your codeigniter project code calls, codeigniter in default using index.php, if using index.php its sense url for web we are not seo, eg www.yourdomain.com/ index.php / contact

and we will delete its index.php to become www.yourdomain.com/contact
add new file
how to open your codeigniter project and add the code below in your root poroyek and name it with .htaccess file and save it, see picture below
.htaccess file
the following .htaccess file
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

then go to \application\config\config.php

and find the code as below
$config['index_page'] = 'index.php'
then delete index.php as below
$config['index_page'] = ''
then try to access your url without index.php


EmoticonEmoticon