Apache mod_rewrite:アドオンドメインを使用する場合は特に%{HTTP_HOST}について説明してください
アドオンドメインを持つApacheサーバーの状況(ディレクトリツリー):
main-domain.com/
|
|_ .htaccess (just an empty file, no rule in here)
|_ index.html (shown when accessing http://main-domain.com)
|
|_ addon-domain-1.com/
| |
| |_ .htaccess
| |_ index.html (shown when accessing http://addon-domain-1.com or http://main-domain.com/addon-domain-1.com/)
|
|_ addon-domain-2.com/
|
|_ .htaccess
|_ index.html (shown when accessing http://addon-domain-2.com or http://main-domain.com/addon-domain-2.com/)
「addon-domain-1.com/.htaccess」ファイルで、次のような%{HTTP_HOST}を使用するルールがあるとします。
RewriteCond %{HTTP_HOST} ^something$
%{HTTP_HOST}
サーバー上で現在要求されているURLのドメインに評価されますか?
したがって、要求する場合:
%{HTTP_HOST} will be "addon-domain-1.com"?
http://addon-domain-1.com(最後のスラッシュなし)
%{HTTP_HOST} will still be "addon-domain-1.com"?
%{HTTP_HOST} will still be "www.addon-domain-1.com"?
そして、求めるとき:
http://main-domain.com/addon-domain-1.com
%{HTTP_HOST} will be "main-domain.com"???
or "main-domain.com/addon-domain-1.com"???