I installed WAMP and followed this guide to set up virtual hosts. In both Google Chrome and Internet Explorer, http://localhost gets me to "WAMPSERVER homepage" with my virtual host listed under "Your Projects."
Clicking that link to http://mysite.local in Chome brings me to my site as expected.
Clicking that link in Internet Explorer displays the following message instead.
This page can’t be displayed
•Make sure the web address http://mysite.local is correct.
•Look for the page with your search engine.
•Refresh the page in a few minutes.
There's several reasons WAMP/MAMP may not work on a local environment, I'll try to list a few reasons here:
There are sometimes multiple httpd.conf files that can cause things to go a little bit funny. MAMP/WAMP usually tend to keep all their configuration files within a
conf/ directory however, that doesn't mean to say some other httpd.conf file is being used...
You can also run this command on Linux based systems to see which one is being used:
apache2ctl -V | grep SERVER_CONFIG_FILE
In the httpd.conf file, there's a line to include the vhosts definitions file, it should be uncommented:
# Virtual hosts # Include conf/extra/httpd-vhosts.conf // remove the #
Vhosts need to be defined as follows:
<VirtualHost *> DocumentRoot "C:/path/to/your/local/site" ServerName mydomain.local </VirtualHost>
On OS X/Linux systems this can be found at
etc/hosts. Edit that to reflect below (note, you'll need to be root)
On windows systems, it can be found in
Browser caches always cause an issue with local servers/development. It's worth working with incognito mode on, or deleting all browser caches each and every time you open it up. There's a few plugins available for most browsers that should help too.
__FILE__or similar to achieve what you want.