I try to set up virtual host for some local site with XAMPP.
I executed next steps:
- In "C:/xampp/apache/conf/extra/httpd-vhosts.conf" I added:
<VirtualHost *:8081> DocumentRoot "C:/xampp/htdocs/" ServerName localhost </VirtualHost> <VirtualHost *:8081> DocumentRoot C:/xampp/htdocs/fw/public ServerName fw.local.com <Directory "C:/xampp/htdocs/fw/public"> DirectoryIndex index.php AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
- Inside "C:/Windows/System32/drivers/etc/hosts" I added:
127.0.0.1 localhost 127.0.0.1 fw.local.com
- Restarted Apache.
And...
If I follow to:
http://localhost:8081/
All is OK: I see my catalog with projects in folder "htdocs".
But! If I follow to:
http://fw.local.com/
I expect to see result of my "index.php" file inside "..htdocs/fw/public". But I get:
This site can’t be reached
fw.local.com refused to connect.
File "C:/xampp/apache/conf/httpd.conf" contains:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Where I was wrong?