[RESOLVED] NooB question: Link to files outside apache's /var/www/ folder
Hi all,
I'm asking this question here because I didn't even know what terms to put in my google search.
My problem is: I have user files stored in a folder outside apache's documents root e.g. My project is in /var/www/ProjectName/ and the files are in /var/uploads/
I think you got it :)
I want to be able to link to those files from within my project, doesn't really matter if the solution involves changing Apache's settings.
Oh and I don't want to rush you or anything but this is urgent
Re: NooB question: Link to files outside apache's /var/www/ folder
Ok, while waiting for any response I tried the following:
I added the following code to the "sites-enabled" settings file
Code:
<Directory "/usr/upload/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
But it's not working and in the error log file I get "File does not exist: /var/www/usr" error which means what I've done was no help at all.
But seriously guys, I'm almost giving up on you
Re: NooB question: Link to files outside apache's /var/www/ folder
What do you mean you want to link to it? Like have a hyperlink to go to that page? You cant do that since it isnt in your webroot.
I am pretty sure you can include it though.
PHP Code:
include('../uploads/myfile.txt');
//or
include('/var/uploads/myfile.txt');
Re: NooB question: Link to files outside apache's /var/www/ folder
Yes I know all of this, but isn't there anyway I can add this path to my DocRoot?
Re: NooB question: Link to files outside apache's /var/www/ folder
If you do that then it kind ruins the idea of having it outside of the document root... why dont you just move the file there yourself?
Re: NooB question: Link to files outside apache's /var/www/ folder
Good question. it has something to do with the hosting service. but you know what, I think I'll move the files there. The easy way.
Thanks
Re: [RESOLVED] NooB question: Link to files outside apache's /var/www/ folder