Tentu menghilangkan, menyembunyikan index.php di URL
CodeIgniter menciptakan URL terlihat lebih rapih di pandang mungkin ^_^, atau niscaya
lebih SEO Friendly.
Berikut contoh tampilan URL CodeIgniter yang masih ada
index.php
![]() |
| Index.php URL CodeIgniter |
Mari kita hilangkan index.php di URL nya, dengan langkah
berikut :
- buat file .htacces root folder yang bersamaan file index.php, dengan struktur file dan folder berikut :
![]() |
| .htaccess CodeIgniter URL |
- Masukan berikut script file .htaccess nya
RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %REQUEST_FILENAME !-f RewriteCond %REQUEST_FILENAME !-d RewriteRule ^(.*)$ index.php/$1 [L]
- Kemudian masuk folder application > config > config.php
![]() |
| Config Index.php CodeIgniter |
- Hapus baris index.php di $config[‘index_page’] = ‘’;
- Silahkan sekarang coba saluran URL nya tanpa index.php, dan berikut gambar akhirnya :
![]() |
| URL CodeIgniter SEO Friendly |
Okeh, nice kan URL nya, ^_^, okeh biar bermanfaat,
Tutorial Tutorial menghapus index.php di URL CodeIgniter.




Post a Comment