0

I have created virtual host in WAMP but browser is always looking for live site. I have commented virtual host line from httpd.conf and my http-vhost file looks like

 <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>

And entries in host file looks like

 127.0.0.1       localhost
 ::1        localhost

 127.0.0.1       ltl_new.local
::1     ltl_new.local

But when I try to access ltl_new.local it gives me server not found and browser url becomes www.ltl_new.local. The apache version is 2.4.9. I have seen this , this and many other related questions but couldn't be able to resolve my problem.

Any help will be much appreciated.

Community
  • 1
  • 1
Awais Qarni
  • 17,492
  • 24
  • 75
  • 137

1 Answers1

0

Dont use _ (underscores) in a domain name, the underscore is not an allowed character in a domain name.

If you remove the _ in both the HOSTS file and the Virtual Hosts Definition file httpd-vhosts.conf then everything should work as otherwise everything looks OK.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149