WAMP:Apache2.4.9的虚拟主机

WAMP:Apache2.4.9的虚拟主机,apache,wamp,virtualhost,Apache,Wamp,Virtualhost,我已经在WAMP中创建了虚拟主机,但浏览器总是在寻找实时站点。我已经在httpd.conf中注释了虚拟主机行,我的http vhost文件如下所示 <VirtualHost *:80> DocumentRoot "D:/wamp/www" ServerName localhost <Directory "D:/wamp/www"> Options Indexes FollowSymLinks AllowOverride All

我已经在
WAMP
中创建了
虚拟主机
,但浏览器总是在寻找实时站点。我已经在
httpd.conf
中注释了虚拟主机行,我的http vhost文件如下所示

 <VirtualHost *:80>
   DocumentRoot "D:/wamp/www"
   ServerName localhost
   <Directory "D:/wamp/www">
     Options Indexes FollowSymLinks
     AllowOverride All
     Require local
  </Directory>
</VirtualHost>


<VirtualHost *:80>
  DocumentRoot "D:/Projects/ltl"
  ServerName ltl_new.local
  ServerAlias ltl_new.local
  ErrorLog "logs/mysilverstripe.log"
  <Directory "D:/Projects/ltl">
     Options Indexes FollowSymLinks
     AllowOverride All
     Require local
  </Directory>
 </VirtualHost>
但当我尝试访问
ltl\u new.local
时,它会给我找不到服务器,浏览器url变成
www.ltl\u new.local
。apache版本是2.4.9。我已经看到了,和许多其他相关的问题,但无法解决我的问题

任何帮助都将不胜感激。

不要在域名中使用
\u
(下划线),下划线在域名中是不允许的字符

如果删除主机文件和虚拟主机定义文件
httpd vhosts.conf
中的
则一切正常

 127.0.0.1       localhost
 ::1        localhost

 127.0.0.1       ltl_new.local
::1     ltl_new.local