Prince Prince - 2 months ago 6
PHP Question

WAMP Server can not direct to the home page

Recently I installed wamp server to set up a server environment in a Windows machine. Everything works great, but I have a little problem.
If I am working on a project named

test
, I can access the project by going to
http://localhost/test
.
When I create a link to go to the root(
test
):
<a href="/">Go to the root test</a>
, I am directed to
http://localhost
instead of
http://localhost/test
.

Is there any way for me to solve this problem ?

Thank you for providing your help.

Answer

Perhaps I'm oversimplifying, but the root is just localhost and a link specified as href="/" will always take you there. To link to the localhost/test directory, which is not your root directory it's href="/test"