CodeIgniter index.phpを表示しないようにする
URL に index.php が含まれてしまうので、その消し方。
いちおう公式に記載があるものの、これだけでは足りなかった。
http://codeigniter.jp/user_guide_ja/general/urls.html
・rewrite.load を有効にする
# ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
・htaccess を有効にする
# vi /etc/apache2/mods-available/xxx AllowOverride All <- 修正
・apache の再起動
# vi /etc/init.d/apache2 restart
・CI直下に htaccess を作成
# vi .htaccess
RewriteEngine On
RewriteBase /myapp/
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^/application.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
※サブディレクトリがない場合は以下のようにする
RewriteBase = ‘/’・config.php の修正
# vi config/config.php $config['index_page'] = ''; <- 修正