Jump to content

[SOLVED] linking above the webroot


c_shelswell

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.