With the new WAMP, you have to create a virtual host site to see it in localhost development. Which I did, and it worked.
However, I just moved that website to a Live server, and I cannot, for the life of me, see the website in my browser. I get a message:
This site can’t be reached
My friends see it, but it cannot be seen by the development computer.
I tried :
httpd-vhosts
All to no avail. And I cannot find information about deleting a website from WAMP!!! Any hint appreciated.
It may be due to the hostname duplicate. Edit the virtual host to fix this.
For windows users, edit your virtual host from
C:\windows\system32\drivers\etc\hosts
and
C:\wamp\bin\apache\apache2.4.23\conf\extra
To edit these files you need to run as administrator. To do this, try the following steps:
Finally restart the server.
I am assuming that you use a local domain name that is the same as your live sites domain name i.e. mysite.com
rather than mysite.dev
So you will have added a line to your HOSTS file like this
127.0.0.1 mysite.com
::1 mysite.com
So from your PC you have told windows your site lives locally on this PC.
All you need to do is remove those 2 lines from your C:\windows\system32\drivers\etc\hosts
file and then either reboot or run (from an admin acoount)
net stop dnscache
net start dnscache
Now Windows does not know where yoursite.com
lives and it will ask a DNS Server for the LIVE sites IP Address, and find your live site.
Babitha's post is correct but I had to make these changes:
For both you need to edit them as administrator
C:\windows\system32\drivers\etc\hosts
C:\wamp64\bin\apache\apache2.4.46\conf\extra\httpd-vhosts.conf
Don't just come paste your apache version can be diffrent and your wamp location in another place.
Edit virtual host that you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With