[CodeIgniter] 移除網址的 index.php

在 CI 裡想要移除預設網址的 index.php,只要打開 .htaccess,並輸入以下內容即可

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



若 CI 是在某個資料夾內,只要改成以下
RewriteRule ^(.*)$ folder/index.php/$1 [L]

留言