Tutorial menghilangkan atau menyembunyikan index.php di CodeIgniter URL SEO Friendly
Tentu menghilangkan, menyembunyikan index.php di URL
CodeIgniter membuat URL terlihat lebih rapih di pandang mungkin ^_^, atau pasti
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 akses URL nya tanpa index.php, dan berikut gambar hasilnya :
![]() |
URL CodeIgniter SEO Friendly |
Okeh, nice kan URL nya, ^_^, okeh semoga bermanfaat,
Tutorial cara menghapus index.php di URL CodeIgniter.
Comments
Post a Comment