ファイルパス:/Users/user_name/Sites/example.com
閲覧可能:http://localhost/~user_name/example.com/
子ディレクトリ(chrome
)で、.htaccess
次のようになりました。
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^rgba\((\d{1,3}%?,\s?\d{1,3}%?,\s?\d{1,3}%?,\s?[0-1]?\.?\d+)\)$ rgba.php?rgba=$1 [PT]
これは、次のようなリクエストに一致します。
http://localhost/~user_name/example.com/chrome/rgba(255,255,255,0.5)
リクエストを次のように書き直す必要があります。
http://localhost/~user_name/example.com/chrome/rgba.php?rgba=(255,255,255,0.5)
rgba.phpをchrome
ディレクトリに配置しました。それでも私はこのエラーメッセージを受け取ります:
The requested URL /Users/user_name/Sites/example.com/chrome/rgba.php was not found on this server.
マニュアルのホームディレクトリ拡張と[PT]フラグの部分を読みましたが、違いはありません。
example.com
ディレクトリを指す仮想ホストを設定すると、機能します。両方の方法で機能させたい=P
では、どうすればよいですか?
MacOSXでApache/2.2.15(Unix)を実行しています
ユーザーディレクトリに対してEDITAllowOverride
が設定されています。それがなかったら、書き直しはまったく機能しなかったはずです。All
Sites