-1
我有窗户与Apache 2.4 XAMPP 10 我有我的C此配置:\ XAMPP \ apache的\的conf \额外\的httpd-vhosts.confXAMPP的Apache 2.4虚拟主机不工作
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
ServerAlias www.localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/site3/web"
ServerName site3.localhost
ServerAlias www.site3.localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/site2/web"
ServerName site2.localhost
ServerAlias www.site2.localhost
</VirtualHost>
我在我的主机添加的文件:
127.0.0.1 site2.localhost
127.0.0.1 site3.localhost
127.0.0.1 www.site2.localhost
127.0.0.1 www.site3.localhost
当我浏览http://site2.localhost我看到XAMPP根索引。 当我浏览http://site3.localhost我再次看到xampp根index.Same与www.site2.localhost ...
我做错了什么?
我只能访问site3。第一个vh。 – user3686739
您不应该删除本地主机定义。这应该留 – RiggsFolly
我评论它: #<虚拟主机*:80> #DocumentRoot的 “C:/ XAMPP/htdocs中” #服务器名本地主机 #\t ServerAlias www.localhost \t #虚拟主机> – user3686739