@jasen
To access files outside the document root in a virtual host in XAMPP, you can create an alias in the virtual host configuration file. Here's how you can do it:
1 2 3 4 5 6 7 8 9 10 11 |
<VirtualHost *:80> ServerName yourdomain.com DocumentRoot "C:/xampp/htdocs/yourdomain" Alias /externalfiles "C:/path/to/external/files" <Directory "C:/path/to/external/files"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> |
In this example, we created an alias /externalfiles that points to a directory outside the document root located at "C:/path/to/external/files".
1
|
http://yourdomain.com/externalfiles/example.txt |
By creating an alias in the virtual host configuration, you can securely access files outside the document root in XAMPP.