jasonc Posted June 4, 2011 Share Posted June 4, 2011 I have a load of photos on our community site that are being used elsewhere as eating up our bandwidth. I have heard that I am able to prevent this from happening by blocking direct access to the images in cpanel, but this would prevent the community logo being used, we allow the logo to be used this way but not wanting the other images. I have seen on some sites some time ago that theu use the following sort of method to show images on their site.. www.site.com/?img=123 which grabs the image from a folder that is not accessable by the public but can be used to 'include' the image to the html file that is sent to the browser. any ideas how i may do this ? Link to comment https://forums.phpfreaks.com/topic/238378-want-to-have-images-in-folder-outside-the-public_html-folder/ Share on other sites More sharing options...
wildteen88 Posted June 4, 2011 Share Posted June 4, 2011 What you want to do is prevent people hotlinking your images on their sites. You can do this by using a .htaccess file as this guide explains. Link to comment https://forums.phpfreaks.com/topic/238378-want-to-have-images-in-folder-outside-the-public_html-folder/#findComment-1225042 Share on other sites More sharing options...
jasonc Posted June 4, 2011 Author Share Posted June 4, 2011 i have heard of this method also, but this also prevents all images from being hotlinked, we want to allow certain images to hotlinked and the others not. Link to comment https://forums.phpfreaks.com/topic/238378-want-to-have-images-in-folder-outside-the-public_html-folder/#findComment-1225044 Share on other sites More sharing options...
wildteen88 Posted June 4, 2011 Share Posted June 4, 2011 Place all the images that cant be hotlinked within a different directory. Using the guide I linked to you can then just place the .htaccess file within that directory. Link to comment https://forums.phpfreaks.com/topic/238378-want-to-have-images-in-folder-outside-the-public_html-folder/#findComment-1225045 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.