php – how to access virtual host set in vagrant-ThrowExceptions

Exception or error:

I am having debian vagrant. I have done virtual host configuration in its apache as servername https:local-dev02.sitename.com. And used in my windows machine host file 127.0.0.1 local-dev02.sitename.com.

I can access my site in windows’ browser as https://local-dev02.sitename.com:8443/.
But I am unable to do

ping https://local-dev02.sitename.com
OR 
curl https://local-dev02.sitename.com
OR 
wget https://local-dev02.sitename.com
How to solve:

It is only possible to ping a hostname or IP address, but not an URL. So you need to put off the protocol like so

ping local-dev02.sitename.com

To reach your hosts via the hostnames, please add the IPs and hostnames to the /etc/hosts file.

Leave a Reply

Your email address will not be published. Required fields are marked *