WAMP服务器不会在localhost和后缀端口号前加上[duplicate]

This question already has an answer here:

Problem 1 :

The folders listed under Your Projects doesn't have the http://localhost/ prefix by default.

So instead of going to http://localhost/your_project/ , it goes to http://your_project/

Problem 2 :

And after changing my default Apache port number to 8085 (due to Skype conflict), the port number wont automatically get suffixed to http://localhost/.

So instead of going to http://localhost:8085/my_project, it simply goes to http://localhost/my_project/ (which obviously does not work).

</div>

Solution to problem 1 :

Locate and open index.php from www directory (C:\wamp\www\index.php)

Find this line :

$UrlPort = $port !== "80" ? ":".$port : '';

Change it to :

$UrlPort = $port !== "80" ? ":".$port : ':8085';

where 8085 is the new port number in your case


Solution to problem 2 :

Locate and open wampmanager.conf from wamp installation directory (C:\wamp\wampmanager.conf)

Find this line :

urlAddLocalhost = "off"

Change it to :

urlAddLocalhost = "on"