Pages

Thursday, December 8, 2011

How to make codeigniter without index.php

In codeigniter index.php will be included by default in the URL. We can remove it so that our URL should be like http://digilib.uad.ac.id/buku/Buku.
To do that just do the following steps:
  1. Open config.php in codeigniter application config directory
  2. replace $config['index_page'] = "index.php" with $config['index_page'] = ""
  3. Create a ".htaccess" file in the root of CodeIgniter directory
  4. write the following script:
    RewriteEngine on
    RewriteCond $1 !^(index\.php|resources|robots\.txt)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA] 
    

No comments:

Post a Comment

Don't Forget To Join Our Community
×
Widget