Apache的mod_rewrite的时候给我解释一下%{HTTP_HOST} expecially:与插件域Apache服务器上使用插件域Apache的mod_rewrite的:使用插件域
情况(目录树)当我解释%{HTTP_HOST} expecially:
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}
评估到服务器上当前请求的网址的域?
所以,如果要求:
%{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"???