我在用Apache 之友 XAMPP http://www.apachefriends.org/en/xampp.html在 Windows(本地服务器)中。我将虚拟主机设置为httpd-vhosts.conf
在 Apache 配置目录中,如下所示
NameVirtualHost *:80
<VirtualHost *:80>
ServerName test.example.com
DocumentRoot "E:\xampp\htdocs\example"
</VirtualHost>
当我浏览 URL 时效果很好
http://test.example.com
是否可以从 Apache .htaccess 动态创建虚拟主机?
背景为VirtualHost
必须server config
。请参阅阿帕奇文档 http://httpd.apache.org/docs/2.2/mod/core.html#virtualhost.
这意味着该指令可能是
在服务器配置文件中使用
(例如,httpd.conf),但不在任何
或者
容器。不允许在
.htaccess 文件。
(指令词典 http://httpd.apache.org/docs/2.2/mod/directive-dict.html#Context)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)