how to change xampp htdocs directory in OSX?

If you forward to a directory in your user root, then:

DocumentRoot "/Users/<your username here>/Sites"
<Directory "/Users/<your username here>/Sites">

Other than the answers mentioned above, I also had to change the line in XAMPP/xampfiles/etc/httpd.conf where it mentions username. the default was set to daemon and I changed it to my username; so there was no permission problem.


Open the following file in a text editor.

/Applications/XAMPP/xamppfiles/etc/httpd.conf

Search for "DocumentRoot", if the line below has a # in front of it than it's commented remove it and change the path between the quote

DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"

Now search for the line below and change the path between the quotes to your needs.

<Directory "/Applications/XAMPP/xamppfiles/htdocs">

NOTICE: Paths similar to ~/ won't work use the absolute path.