誰もが調べるであろう「index.phpの省略」・・・
(例えば http://localhost/blog/public/index.php/post を http://localhost/blog/public/post でアクセスしたい)
ここでえらくハマっていたので覚え書き。
調べたら出てくる変更
調べたらすぐに出てくる3つの変更。
fuel/app/config/config.php
/**
* index_file - The name of the main bootstrap file.
*
* Set this to 'index.php if you don't use URL rewriting
*/
- //'index_file' => false,
+ 'index_file' => false,
PROJECT_NAME/public/.htaccess
#Remove index.php from URL
- #RewriteCond %{HTTP:X-Requested-With} !^XMLHttpRequest$
- #RewriteCond %{THE_REQUEST} ^[^/]*/index\.php [NC]
- #RewriteRule ^index\.php(.*)$ $1 [R=301,NS,L]
+ RewriteCond %{HTTP:X-Requested-With} !^XMLHttpRequest$
+ RewriteCond %{THE_REQUEST} ^[^/]*/index\.php [NC]
+ RewriteRule ^index\.php(.*)$ $1 [R=301,NS,L]
httpd.conf
- AllowOverride None
+ AllowOverride All
これをやってなかった
apacheの設定。mod_rewrite読み込み有効にしてなかった…!
httpd.conf
- #LoadModule rewrite_module libexec/apache2/mod_rewrite.so
+ #LoadModule rewrite_module libexec/apache2/mod_rewrite.so
参考サイト
おかげさまで解決いたしました。ありがとうございました。
http://pilomen164.hatenablog.com/entry/2013/09/23/191957