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
_________________________
Code monkey like Fritos

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

Wizard

Registered: 01/10/00
Posts: 5287
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 Online   shocked

Wizard

Registered: 01/10/00
Posts: 5287
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 Online   shocked

Wizard

Registered: 01/10/00
Posts: 5287
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
2 registered (Gizmo, Ruben Rocha), 31 Guests and 21 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Ubb - Buy It!
best forum software
Latest Posts
I want to create a Self Search mod [Question]
by lightningrod
03/10/10 09:04 PM
If I create a new script, can I just upload it?
by lightningrod
03/10/10 05:35 PM
Notepad Creates Errors when working with PHP
by lightningrod
03/10/10 05:01 PM
Question on Adding a New Script ?
by lightningrod
03/10/10 06:39 AM
Disable Watch List option
by Mike_Tabat
03/09/10 01:27 PM
[7.x] [Pre-7.3] [Final] pJIRC Addon v0.5
by Gizmo
02/27/10 05:07 PM
How to Be a Great Host
by pinku
02/19/10 02:47 AM
New Mods
Disable Watch List option
by Mike_Tabat
02/18/10 09:14 AM
[7.x] Generic Page Outside of forum directory
by
01/14/07 10:58 PM
[7.x] Halloween
by
10/11/06 04:03 PM
[7.x] [Pre-7.3] [Final] pJIRC Addon v0.5
by
07/30/06 10:42 PM
Newest Members
Vick, Bartman, Infinity Master, Cry0, Romeos Tune
13494 Registered Users
Top Posters
AllenAyres 25554
JoshPet 11330
Rick 8373
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438
(Views)Popular Topics
Known public proxy servers 1028046
Finished-[6.5.2] Games Arcade Deluxe v1.9 327222
Integrated Index Page (IIP) 5.3.1 279924
Integrated Index Page (IIP) 5.1.1 279403
TLD Bv2.1 Released - Threads Links Directory 270427
[6.0x] Who's Online 4.0.0 [Finished] 230365
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 217518
[6.3.x] [beta] Hit Hack 2.0 179339
FlashChat & UBB.threads 161010
[7.x] Gizmo's Embedding BBCode (Pre UBB.T7.3) 154650
Forum Stats
13495 Members
59 Forums
37114 Topics
290378 Posts

Max Online: 686 @ 06/28/07 07:04 AM
Featured Member
Registered: 11/27/09
Posts: 4

 

 

 
fusionbb message board php hacks