Linking sites to htdocs in Xampp OSX

I usually do not want to put my webprojects inside the htdocs directory in the default Xampp setup. Depending on the type of project I want them in different places. One simple way to run them from htdocs (localhost/projectname) is to make symbolic links to the projects in the htdocs folder. Here is how I did it:

1. Navigate to the htdocs folder in the Xampp package, normaly ‘/Applications/XAMPP/htdocs/‘
2. Run the command ‘ln -s <path to project>‘. Eg ‘ln -s /Users/niklas/NetBeansProjects/project1‘

This will create a symbolic link called ‘project1‘ in you htdocs directory pointing to the ‘/Users/niklas/NetBeansProjects/project1‘ directory.

Apache will, with the default settings, run the project as if it really was inside the htdocs directory. Just navigate to ‘http://localhost/project1‘ and enjoy the result

There are other ways to accomplish the same result but this it the solution I like the best

Linking sites to htdocs in Xampp OSX
Tagged on:
Niklas Tech Blog
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.