Apache mod_rewrite: giải thích cho tôi% {HTTP_HOST} expecially khi sử dụng domain addonApache mod_rewrite: giải thích cho tôi% {HTTP_HOST} expecially khi sử dụng domain addon
Tình (thư mục cây) trên một máy chủ với lĩnh vực addon 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/)
Hãy nói rằng trong tập tin "addon-domain-1.com/.htaccess" tôi có một số quy tắc sử dụng% {HTTP_HOST} như:
RewriteCond %{HTTP_HOST} ^something$
Liệu %{HTTP_HOST}
đánh giá miền của url hiện được yêu cầu trên máy chủ ???
Vì vậy, nếu yêu cầu:
%{HTTP_HOST} will be "addon-domain-1.com"?
http://addon-domain-1.com (không dấu gạch chéo thức)
%{HTTP_HOST} will still be "addon-domain-1.com"?
%{HTTP_HOST} will still be "www.addon-domain-1.com"?
Và khi yêu cầu:
http://main-domain.com/addon-domain-1.com
%{HTTP_HOST} will be "main-domain.com"???
or "main-domain.com/addon-domain-1.com"???