Menghilangkan index.php CI di webhosting
June 15, 2011
PHP Code Ignitier
Tutorial ini di gunakan untuk hosting di 000webhost.com:
- buka file config.php pada folder CI Anda (application\config\), cari kode dibawah:
- Lalu edit file
.htaccesspada root direktori Anda (sejajar dengan folder system, file index.php, dan license), dan masukan kode dibawah kedalam file.htaccess
$config['index_page'] = "index.php";
Hilangkan index.php, jadi:
$config['index_page'] = "";
save file tersebut.
sehingga menjadi
# Do not remove this line, otherwise mod_rewrite rules will stop working
RewriteBase/
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
- Ok beres, sekarang coba url halaman kalian tanpa index.php (http://ilmu-linux.com.com/blog), lihat screenshot aplikasi punya saya: