Suppose there is an instance of apache whose web directory is:


Is it possible to create a link from a file in a distinct directory so that a web user can download that file using the link?

For example,

cd /home/user
echo "test" > test.txt
sudo ln -s test.txt /var/www/html/test.txt

When I browser the web directory, the link file is not shown.


My goal is to create a unique URL for each file (which does not necessarily have to be unique), per download.


You have to enable the symlink in your Apache config file (FollowSymLinks): https://httpd.apache.org/docs/2.4/mod/core.html#options

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.