1

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.

Prince
  • 1,190
  • 3
  • 13
  • 25
  • point your test folder as your root document http://stackoverflow.com/questions/31635648/how-to-change-the-www-root-directory-on-wampserver-2-5 – JYoThI Sep 24 '16 at 12:16
  • 1
    You need to create a Virtual Host for each of your projects. Remember as you have it setup localhost points to `C:\wamp\www` and not `C:\wamp\www\test` Theis [will explain the situation and the solution](http://stackoverflow.com/questions/23665064/project-links-do-not-work-on-wamp-server/23990618#23990618) – RiggsFolly Sep 24 '16 at 15:26

1 Answers1

1

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"

RigidBody
  • 656
  • 3
  • 11
  • 26
  • 1
    WHile this is an answer. If you use this approach, when you come to move your site to a live environment you will have to recode – RiggsFolly Sep 24 '16 at 15:29