.htaccessに設定を記述したのに反映されない場合は、.htaccessの読み込みをするように設定していない可能性があります。
以下、.htaccessに記述した設定を読み込むようにする設定を記述します。
# httpd -v Server version: Apache/2.2.3 Server built: Feb 23 2012 21:16:56
# lsb_release -sd "CentOS release 5.8 (Final)"
httpd.confを確認すると、以下の記述があります。
(OS, Apacheのバージョンによりhttpd.confが異なる場合があるかもしれません。)
# This should be changed to whatever you set DocumentRoot to. # <Directory "/var/www/html"> <省略> # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride None
上記に記述されているように、AllowOverride NoneのNoneをAllに変更すれば.htaccessファイルを読み込むようになります。
<省略> # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All
AllowOverride Allに修正し設定ファイルを保存したら、Apache(httpd)の再起動が必要です。