/    Sign up×
Community /Pin to ProfileBookmark

deny directory listing/search

Hello Members,
I’m a newbie in website development, so forgive me for stupid questions and the long explanation.
In which way is it possible to deny downloading an image file from a directory on a webserver from the locationbar ?
Here my problem:
I have images in a directory /photos.
My webaddress is www.mysite.com
The website info shows me for the location of the image file www.mysite.com/photos/sample.gif
Everyone can download the file as soon as one puts this address into the location bar. And exactly this possibility I want to prevent.
Is it possible ? If so in which way ?

Thank you for any suggestions hints to look for…..

Bingo5

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@AdamGundryJun 06.2004 — You could try using a .htaccess file like this (based on code [url=http://www.thesitewizard.com/archive/bandwidththeft.shtml]here[/url]):

SetEnvIfNoCase Referer "^$" locationbar=1
<FilesMatch ".(gif|png|jpe?g)$">
Order Deny,Allow
Deny from env=locationbar
</FilesMatch>


Bear in mind this may cause problems for users whose browser does not set the HTTP_REFERER header correctly.

Adam
Copy linkTweet thisAlerts:
@Bingo5authorJun 06.2004 — Hi Adam,

will try that and see if it's what I think of.

Bingo5
×

Success!

Help @Bingo5 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...