php forum
php mysql forum
php mysql smarty
 
Page 2 of 2 < 1 2
Topic Options
#87788 - 02/21/04 11:31 AM Re: Stop hot linking of your images
Stilgar Offline
Old Hand

Registered: 02/06/01
Posts: 2324
Loc: Northern California
Bring back this old topic.

AA, I see your banana is still being stolen. :rolleyes:

So, if I wanted to use the Apache htaccess dealie, how would I write it if I wanted to excluse a directory in my domain. I need at least one directory so I can post images. smile

Thanks for the help!

Top
Buy Stuff!
#87789 - 02/21/04 01:30 PM Re: Stop hot linking of your images
Ian Spence Offline
Master Hacker

Registered: 01/25/03
Posts: 3765
Loc: Saint Johns, PA
Quote:
Originally posted by Stilgar:

So, if I wanted to use the Apache htaccess dealie, how would I write it if I wanted to excluse a directory in my domain. I need at least one directory so I can post images. smile

Thanks for the help!


This is exactly what I want. I want to prevent hotlinking of the images inside my graemlins, avatars, graphics, and ubb directory, but I want to allow hotlinking from my webroot

Top
#87790 - 02/21/04 02:14 PM Re: Stop hot linking of your images
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5305
Loc: Portland, OR, USA
Good to know other people make use of this. I'd include mine but it's about 3 pages long... I have it for: exe|zip|c|jpg|gif|bat|tar|gz|tgz but with numerous allowed sites (including the IP for my site since it's dedicated (I work for the host so why not lol)).

Your instructions are about the same as I have in the KBASE at HostNuke lol.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#87791 - 02/21/04 02:31 PM Re: Stop hot linking of your images
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5305
Loc: Portland, OR, USA
Keep in mind that users who use security suites or right click and choose save as will in most cases error out since their browser will send a blank referrer.

To allow these users you use the line:
Code:
RewriteCond %{HTTP_REFERER} !^$

The only way to actually allow them is to allow blank referrers but that'll leave your info open to people who just choose save as from remote locations smirk...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#87792 - 10/26/04 07:35 AM Re: Stop hot linking of your images
AerisHime Offline
Junior Member

Registered: 10/26/04
Posts: 1
Loc: Berlin
Hey there,

reviving this topic again, I would like to know following:

I have set up a wiki (mediawiki 1.3) for University, which has the purpose to get the materials we use at certain seminars. The wiki itself is restricted enough, so you cannot see pages w/o logging in and you can't create accounts for yourself.
Okay, now the thing is: when you upload the pdfs, the directories in ..[wiki-folder]/images are created somehow randomly, like images/1/1f/file.pdf, so I cannot create .htaccess files for each folder, only for images (i dont know, where the files go before uploading them and it would be lots of work to do it for each folder separately).

I tried the codes that were posted before, but it was still possible to get the files without being logged in.

So, how do I limit downloading the pdfs to clicking on the wiki-links?

almost resigning,

Aeris

Top
#87793 - 10/26/04 09:48 AM Re: Stop hot linking of your images
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5305
Loc: Portland, OR, USA
Code:
RewriteCond %{HTTP_REFERER} !^https://www.yoursite.tld [NC]
RewriteCond %{HTTP_REFERER} !^https://yoursite.tld [NC]
RewriteRule [^/]+.(pdf)$ - [F]

That should work for your use. Note that the
Code:
RewriteCond %{HTTP_REFERER} !^$

should only be used if you want "blank referrers" to be allowed access (basically someone pasting the URL into their browser).
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
Page 2 of 2 < 1 2



Moderator:  Gizmo, Ian_W 
Who's Online
0 registered (), 49 Guests and 7 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Ubb - Buy It!
best forum software
Latest Posts
[7.2.1] - Naked shoutbox
by MithofOT
08/31/10 01:58 PM
[7.5.5] getting $_COOKIE to work
by gtho4
08/29/10 12:28 AM
Jelsoft Bought
by AllenAyres
08/20/10 04:44 PM
UBBDev Now Running Threads 7.5.6
by AllenAyres
08/18/10 07:59 PM
How do I add another field to the profile page?
by Gizmo
08/05/10 09:24 AM
UBB developer needed.
by AllenAyres
08/03/10 02:57 PM
New Mods
How do I add another field to the profile page?
by Vee
08/05/10 06:02 AM
[7.2.1] - Naked shoutbox
by sirdude
08/17/07 10:36 PM
Newest Members
stevebrummie, Neronrg, Vee, dessy, Manish
13533 Registered Users
Top Posters
AllenAyres 25565
JoshPet 11330
Rick 8373
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438
(Views)Popular Topics
Known public proxy servers 1224347
Finished-[6.5.2] Games Arcade Deluxe v1.9 375009
Integrated Index Page (IIP) 5.3.1 345193
Integrated Index Page (IIP) 5.1.1 322504
TLD Bv2.1 Released - Threads Links Directory 301614
[6.0x] Who's Online 4.0.0 [Finished] 267207
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 244632
[6.3.x] [beta] Hit Hack 2.0 197599
[7.x] Gizmo's Embedding BBCode (Pre UBB.T7.3) 173774
FlashChat & UBB.threads 169520
Forum Stats
13533 Members
59 Forums
37128 Topics
290448 Posts

Max Online: 686 @ 06/28/07 07:04 AM
Featured Member
Registered: 07/03/01
Posts: 811

 

 

 
fusionbb message board php hacks