c_shelswell Posted April 9, 2007 Share Posted April 9, 2007 Hi i've been trawling the net for a few hours trying to get information on this but so far im not really finding any answers. I'm trying to link to files above the webroot (redhat & php 4.4.4) in order to not make the accessible by simply typing http://www.domain.com/file.mp3 everywhere i reading is that i would need to change my apache conf or use php to redirect. i've tried links like /home/myuser/products/file.mp3 but to no avail. If i change my apache conf file won't this still allow anyone to access the files if they knew the address? Can anyone shed any light on how i might do this? Many thanks Link to comment https://forums.phpfreaks.com/topic/46254-solved-linking-above-the-webroot/ Share on other sites More sharing options...
veridicus Posted April 9, 2007 Share Posted April 9, 2007 You could make a symlink to the file from your web directory to your user directory. Then apache needs to be configured to follow symlinks (which can be done in .htaccess). Or you could have a PHP file which catches requests and "manually" starts the download for the user. It would sort of be a filter which you can control with code. If you go this route just make sure the account which apache/php run under have read access to the file. Link to comment https://forums.phpfreaks.com/topic/46254-solved-linking-above-the-webroot/#findComment-224957 Share on other sites More sharing options...
c_shelswell Posted April 9, 2007 Author Share Posted April 9, 2007 thanks for the reply i currently have the file downloading via a "Header(Location: ...." request i'm not sure what you mean or how i would implement your second idea of the php file?? Thanks very much or the help Link to comment https://forums.phpfreaks.com/topic/46254-solved-linking-above-the-webroot/#findComment-225119 Share on other sites More sharing options...
c_shelswell Posted April 9, 2007 Author Share Posted April 9, 2007 solved -> found a script on the bottom of the PHP online manual under a search for symlinks. Many thanks Link to comment https://forums.phpfreaks.com/topic/46254-solved-linking-above-the-webroot/#findComment-225133 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.