Set document root with htaccess

Hi Guys!

I’m working on an application locally. In this application, the links are all like so: <a href=“/contact”>Contact</a>. As you can see they don’t include a full path so what happens is when someone clicks on the link it takes you back to the Document_Root of the web server.

Is there a way for me to set the Document_Root using .htaccess?

The setup is like so:

My files are all in the “http://localhost:8888/” directory.

Just as an example, my index file will load up a link for example <a href=“/contact”>Contact</a> and when clicked it takes the person to the following link: http://localhost:8888/contact

What I want to happen is redirect the link to: http://localhost:8888/

I hope this makes sense.

What you are describing is the purpose of virtual host. You should setup a virtual host on your machine. You can than specify the document root and server alias along with a bunch of other information.
Here is a article on setting up virtual hosts on windows.