The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Blocking Direct Image Loads in Browser with htaccess
Nick
post Feb 21 2007, 07:04 PM
Post #1


Member
***

Group: Members
Posts: 32
Joined: 29-September 06
Member No.: 268





Is there any way at all to stop images from being displayed when their URLs are typed directly into a browser? I don't really care if people can load them into web pages, I just want to stop people from typying http://www.blah.com/blah.jpg into a browser and seeing an image. Instead I want to redirect them to something else... a page of all images perhaps.

Any thoughts?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Effovex
post Feb 21 2007, 10:11 PM
Post #2


Serious Coder
*****

Group: Members
Posts: 251
Joined: 6-January 07
From: Sherbrooke, Qc, Canada
Member No.: 1,477



Not really possible. You could in theory check if the referer header is set, and if it's not redirect to the gallery, but that would prevent users who have disabled that (optional) part of HTTP from seeing your images. The best thing you can do is have http://www.blah.com/images/blah.jpg and have http://www.blah.com/images/ contain the gallery. This way people who want to access the gallery just have to remove blah.jpg to get there (or, in Opera, hold right-click, mouse up, mouse left, release right-click)
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 8th May 2024 - 08:26 AM