Jumat, 15 Agustus 2014

Remove Index.php codeigniter di address browser

# Windows

1. Buat file baru ".htaccess" di folder root tanpa tanda petik, isi file dengan syntax berikut :

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

2. Buka File "..\application\config\config.php, ubah $config['index_page'] = "";

3. Buka file " ..\xampp\apache\conf\httpd.conf" , jika menggunakan zend "..\zend\Apache2\conf\httpd.conf"
- Aktifkan "LoadModule rewrite_module modules/mod_rewrite.so" dengan menghilangkan tanda # atau tambahkan bila belum ada.
- Pastikan syntax AllowOverride All yang ada di tag <Directory ".. \xampp\htdocs">

<Directory "../xampp/htdocs">
   ...
    AllowOverride All
   ...
</Directory>


# Linux

1. Ikuti langkah pertama dan kedua windows.
2. Aktifkan "mod_rewrite.so"
- buka terminal
- ketik "sudo a2enmod rewrite"
- restart apache, ketik "sudo service apache2 restart"
3. Buka file "..\etc\apache2\sites-available\default". Pastikan syntax AllowOverride All yang ada di tag <Directory ".. \var\www">

<Directory ".. \var\www">
   ...
    AllowOverride All
   ...
</Directory>