【CodeIgniter】Hostingerのレンタルサーバで.htaccess設定
Hostingerのレンタルサーバは.htaccessが使えると公式で言っているので、CodeIgniterのindex.phpを消すためにいつもの.htaccessを使ってみたがうまくいかなかった。
いろいろと探してみたところ、次の.htaccessを使えばうまく動作することが分かった。
RewriteBase / RewriteEngine On RewriteCond %{REQUEST_URI} ^/system.* RewriteRule ^(.*)$ index.php?/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)$ index.php?/$1 [L]