WAMP - Remove localhost from project URL

前端 未结 16 1703
暖寄归人
暖寄归人 2020-12-02 11:01

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/

16条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-02 11:14

    Okay, I had this problem. So, I troubleshooted the problem and traced it to an actual solution, NOT A HACK.

    The SOLUTION :

    1. Right-Click WAMP-server icon
    2. Select WAMP Settings,
    3. Select (enable) option Add localhost in URL


    DONE. The remainder is FYI of how and why.


    Note: localhost/myproject.php or myproject.php. Although the solution was already accepted, I saw some posts that got me confused. The accepted solution is based on a single project wrt different server applications, based on the OP's specific question, and how to influence that single project in question. But all the other solutions are hacks and don't really answer the solution to the OP's question, but do bring up a good point about the URL. So, according to the other "solutions", here is how to toggle the localhost reference in the URL. Hence my additional solution added to the mix.


    This is a toggle switch.

    Troubleshooting Process (no hacking involved):



    Let's peek at the index.php


    Let's look at the config file. Note the variables and Array?


    Here is the array. A variable used earlier. Let's see... Oh, it tells us where and what to do.


    As noted in the SOLUTION:

提交回复
热议问题