I’m reading the Jump Start PHP Environment and can’t seem to get chapter 3 hosts file edit example to work.
I’ve edited the hosts file as an administrator to include “208.117.229.217 www.example.com”. Except when I go to www.example.com I get a 404 page in Edge, but I get example.com in Chrome (should be google). Not sure what I’m doing wrong.
In cmd I ran “ping example.com” which returned IP 93.184.216.34, while pinging www.example.com brought back 208.117.229.217 like expected. Running example.com in edge returns example.com while running www.example.com in edge returns HTTP 404. So looks like the hosts file is working, but I can’t see to get access to the internet.
I want this to work, b/c in chapter four you make an edit ‘192.168.10.10 homestead.app’. This one returns a “Hmm, we can’t reach this page.” Error instead.
Edit: after clearing the cache and restarting Chrome I get the same 404 page.
So, if you want to have single IP point to both domains in your hosts file, then you’d enter something like this.
192.168.10.10 example.com www.example.com
I’d also use that IP too. The 208 IP probably isn’t going to work and was just used as an example in the book.
The “Hmm. we can’t reach this page.” is probably the 404 page response from your VM. So, that means you are on the right track, because you are connecting with your VM. Now all you need to do is to figure out how to get the server to respond properly.
Thank you for the reply, this helped me stay on track. I was able to make my VM connection work. However, the 208 IP was suppose to send me to google. When I manually enter it it works. I tried other IP’s, and none of them seem to work. Only the one to my local host. Is this normal?