私は、Symfony 1.4プロジェクトのドメインを書き直しています。正しくdomain.org/api.php/methodに行くサブドメインをファイルに書き換えてから.htaccess認証を削除する
私の.htaccess
AuthUserFile /var/www/.htpasswd
AuthType Basic
AuthName "GH Auth"
<Files "*">
require valid-user
</Files>
<Files "api.php">
Allow from all
Satisfy any
</Files>
<Files "apc.php">
require user admin
</Files>
<IfModule mod_rewrite.c>
RewriteEngine On
# uncomment the following line, if you are having trouble
# getting no_script_name to work
RewriteBase/
RewriteCond %{HTTP_HOST} ^api\.domain\.org$
RewriteRule ^(.*)$ api.php [QSA,L]
# we skip all files with .something
RewriteCond %{REQUEST_URI} \.(css|js|png|gif|jpg)$
RewriteRule .* - [L]
# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# no, so we redirect to our front web controller
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
は、認証なしで続行することができます。
しかし、api.domain.org/methodに行くとフラグが見えないように見えますが、依然として認証が求められます。
アイデア?たぶん、2つの別々の仮想ホストを作る時でしょうか?
書き換えルールで 'PT'フラグを使ってみましたか? 'L 'と組み合わされた" Pass Through "は、apacheに結果のURIをマッピングエンジンを通して返すよう指示します。 –