Mar*_*aio 10 apache dns mod-rewrite add-on http-host
Apache mod_rewrite:解释我%{HTTP_HOST},特别是在使用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/)
Run Code Online (Sandbox Code Playgroud)
让我们说"addon-domain-1.com/.htaccess"文件我有一些使用%{HTTP_HOST}的规则,如:
RewriteCond %{HTTP_HOST} ^something$
Run Code Online (Sandbox Code Playgroud)
是否%{HTTP_HOST}评估服务器上当前请求的URL的域???
所以如果要求:
%{HTTP_HOST} will be "addon-domain-1.com"?
Run Code Online (Sandbox Code Playgroud)
http://addon-domain-1.com(没有最终斜杠)
%{HTTP_HOST} will still be "addon-domain-1.com"?
Run Code Online (Sandbox Code Playgroud)
%{HTTP_HOST} will still be "www.addon-domain-1.com"?
Run Code Online (Sandbox Code Playgroud)
当要求:
http://main-domain.com/addon-domain-1.com
%{HTTP_HOST} will be "main-domain.com"???
or "main-domain.com/addon-domain-1.com"???
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
20167 次 |
| 最近记录: |