mrcastle Posted February 2, 2010 Share Posted February 2, 2010 I want to have a folder where I can put files, images, etc... which won't be accessible from the outside but still be accessible from my web site. With .htaccess I can prevent direct access to a folder's content. This works fine when I need to include a PHP file that I don't want accessible directly, but it blocks access if I link to a .zip for download (obviously). So, basically what I'm wondering is if there's a way, via PHP and/or .htaccess that I can have a folder (or 2/3 separate folders) that contain : PHP files accessible only when included from a file on my server (easy enough...) Images, ZIP files and other files which can only be downloaded/included/accessed if linked to or included in files on my server. Hoping that made sens... Thanks for any help! Quote Link to comment Share on other sites More sharing options...
trq Posted February 2, 2010 Share Posted February 2, 2010 Move any files you want protected outside of your web root. Then you can include them as required, or use a script to allow images etc to be downloaded. Quote Link to comment Share on other sites More sharing options...
gizmola Posted February 2, 2010 Share Posted February 2, 2010 I'm sure the next question will be how, and pretty much everything you need to know as well as examples can be found here: http://us.php.net/fpassthru. Make sure you read the comments!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.