Lampp/Apache - Make files not available from htdocs folder via HTTP

444 Views Asked by At

i have lampp installed on my maschine with apache. I dont even know if that is relevant for my question...

i am trying to create a way (php, html) for users (from my website) to download files which are not inside the htdocs folder is that possible? the reason i want to know this is, that i don't want anyone else to have access to those files by just typing in the url of the file.

cheers, Friedrich

3

There are 3 best solutions below

0
On
10
On

yes, you can, as many as you want.

Open the file [xamp_installation_folder]/apache/conf/httpd.conf in any text editor.Copy below lines after the htdocs element after changing the directory to your own folder.

<Directory "C:/path/to/your/folder">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Then search for this string: . Inside that element, add a new alias as followed:

Alias /yoursite/ "C:/path/to/your/folder/yoursite/"
Save the file and restart the XAMPP server.

Complete link is here

0
On

Several options, the least load is probably X-Sendfile