Protecting Image Folder And Images In Yii, Apache Blocks The Access!

Currently I have a user_image directory under www and yii can access it in order to

populate the


<img>

tag in my form. But If someone copy the image link address,

they can access the user_image directory and view all other images too if they randomly modify

the image name.

I tried to use .htaccess but it blocked yii too. Basically I wanna know if there is

a way that I can still allow my website to display images in image tag on the html page but

doesn’t expose the actual path to the file ? or if it does, it doesn’t allow the user to directly

view all the images ?

I appreciate your ideas and suggestions :)

Please put your images in "protected" folder.

Check this link for reference : http://www.yiiframework.com/forum/index.php/topic/43922-accessing-images-in-protected-folder/page__p__208239__hl__image+folder#entry208239