I've come across some ways one would deal with this, but 1) some are bad practice for security reasons 2) some don't always work on any system.
I find it odd that the correct way to deal with this isn't outlined in the most basic documentation, everybody has this problem, right?
What's best practice for solving this problem?
Ways I have found inlcude:
A) Modyfing permissions of /opt/lampp/htdocs in some way so that the regular Linux user can edit them with, using chmod, chown.
What's the safest way to do this? If not leading to security issues, I suspect owning htdocs to regular user has lead to other issues with mySQL server for me.
B) development files are in some folder in user space. Symlink this folder into a subdirectory of htdocs with ln -s ~/devfiles /opt/lampp/htdocs/subfolder
That sometimes gives 403 error, but I've been able to fix that on one of my systems by setting User to ben in /opt/lampp/etc/httpd.conf, while this fix didn't work for me on another machine - both running Manjaro Linux.
C) Configure an alias in Apache, as described here:
https://wiki.archlinux.org/index.php/XAMPP#Hosting_files_outside_the_htdocs_directory
Hosting files outside the htdocs directory:
The document root (web root) directory is located at /opt/lampp/htdocs/. All files placed in this directory will be processed by the web server.
To host other files on your system with XAMPP, you can configure an alias with apache