Virtual Host in XAMPP Windows 7

I am trying to create a virtual host in xampp windows 7.

#NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/project/Trunk/xyz"
    ServerName xyz.local
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs"
    ServerName localhost
</VirtualHost>

      

host

127.0.0.1       localhost
127.0.0.1       xyz.local

      

Edit Result 1: httpd -t -D DUMP_VHOSTS

Below

VirtualHost configuration: *:80 is a NameVirtualHost default server abcd (C:/xampp/apache/conf/extra/httpd-vhosts.conf:45) port 80 namevhost abcd (C:/xampp/apache/conf/extra/httpd-vhosts.conf:45) port 80 namevhost localhost (C:/xampp/apache/conf/extra/httpd-vhosts.conf:49) port 80 namevhost xyz.local (C:/xampp/apache/conf/extra/httpd-vhosts.conf:53) *:443 www.example.com (C:/xampp/apache/conf/extra/httpd-ssl.conf:102)

Edit 2: Attachment - No website error found

enter image description here

The call http://xyz.local/

shows a website not found error. But if I configured the whole thing with only xyz

(not .local

in line xyz.local

) it works fine after being called http://xyz/

. I want it like http://xyz.local/

. How can I achieve this?

+3


source to share





All Articles