I have a project setup and i'm trying to access a file from a temp folder on the server.
The document root for the website is similar to this:
/a/b/c/d/e/f/g/h/mywebsite.com (of the letters have proper names).
The file I need to read lives here:
/a/b/c/myfile.txt
I've tried symbolic links but may have done them wrong... any ideas?
The DocumentRoot is the top-level directory in the document tree visible from the web and this directive sets the directory in the configuration from which Apache2 or HTTPD looks for and serves web files from the requested URL to the document root.
On Ubuntu, the Apache web server serves documents stored in the var/www/html directory by default. This directory is referred to as the document root.
You can create a directory alias:
<VirtualHost....>
..... stuff .....
Alias /mydir /a/b/c
</VirtualHost>
then you could access the text file like so:
domain.com/mydir/myfile.txt
Note that this needs to take place in the central configuration file, not a .htaccess
file.
Symlinks are an option too. Make sure you have
Options +FollowSymlinks
turned on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With