The URLs of my projects in WAMP are not resolving as I'd expect. For example, I'd expect the project in the folder c:\wamp\www\project1 to have the URL http://project1/, but it actually has the URL http://localhost/project1/.
This can cause problems when accessing server variables. How do I fix this?
You can update "urlAddLocalhost" variable in "wamp64/wampmanager.conf" file to on/off. By default it is "off".
My wamp version is 3.0.6.
i also faced same problem after installing new wamp setup on window 7, 64bit. just change line no. 30 $suppress_localhost = false; Its work for me.
For me was the easiest way go to http://localhost and in wampserver homepage use
Add a Virtual Host
(Tools section). There is nice and easy form to create alias without any problem (instead console when you using tray icon to create alias). No source edit, just using what wamp offers. Remember refresh DNS after creating of alias. Tested on Win10, WampServer 3.0.6 64bit.in your www folder open index.php at line 30 change: $suppress_localhost to be false
this is should look:
$suppress_localhost = false;
Open index.php in www folder and set
$suppress_localhost = True;===>$suppress_localhost = false;
that is work.
HostnameLookups ON not OFF in httpd.conf with DocumentRoot changed or not. tested in browser for $_SERVER['HTTP_HOST'] $_SERVER['SERVER_NAME'] $_SERVER['DOCUMENT_ROOT']