Apache は、エイリアス ディレクトリに .htaccess ファイルをロードしません。
.htaccess ファイルをルート フォルダー (D:/Development) とプロジェクト フォルダー (D:/Development/code/project) に配置すると、
http://localhost/filename.html
私をstackoverflowにリダイレクトします。
http://localhost/project/filename.html
見つからない 404 を返します。
Windows 7 64ビットでxamppを実行しています。
サブディレクトリで .htaccess を使用できないのはなぜですか?
httpd.conf:
<Directory />
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Deny from all
</Directory>
<Directory "D:/Development">
Options +Indexes +FollowSymLinks +Includes +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
httpd-vhosts.conf:
Alias /project "D:/Development/code/project/"
<Directory "D:/Development/code/project/">
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
.htaccess (リダイレクトはテスト用です):
redirect 301 /filename.html http://stackoverflow.com
AddDefaultCharset utf-8
RewriteEngine ON
RewriteRule ^(stylesheet|images|favicon) - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ /index.php [NC,L]