php forum
php mysql forum
php mysql smarty
 
Page 1 of 2 1 2 >
Topic Options
#87768 - 06/22/03 11:18 PM Stop hot linking of your images
1QuickSI Offline
Coder

Registered: 06/10/01
Posts: 705
Loc: CT
In your .htaccess file

This will return a 403 forbidden error.
Code:
[/code]This replaces the linked image with one of your choosing.
[code]

In both examples replace YourDomain with either your domain or your hosts.
_________________________
...Steven
Hostboard.com
Running UBB v6.1.0.4
Doing what NO other UBB in the world is doing.
The first & only production UBB powered by MySQL.

Top
Buy Stuff!
#87769 - 06/23/03 06:50 AM Re: Stop hot linking of your images
LK Offline
Admin / Code Breaker

Registered: 03/24/01
Posts: 7396
That's what I use:
Code:
[/code]loggin.cgi:
[code]

now when someone tries to access images, they get a picture. when they try to access other files, they get an HTML page telling them it's not allowed. it's also logged:
[code][/code]
_________________________

My Hacks Page (will be back with UBB 7!)
UBBDev - We put the class into UBB.classic!

Top
#87770 - 06/23/03 09:40 AM Re: Stop hot linking of your images
tgreene Offline
Member

Registered: 11/28/02
Posts: 187
Loc: Jonesboro, Arkansas
Where do I find an .htaccess file, or do I simply need to create it and place it in a specific directory..?

Top
#87771 - 06/23/03 09:57 AM Re: Stop hot linking of your images
LK Offline
Admin / Code Breaker

Registered: 03/24/01
Posts: 7396
If your server is Apache, you just create it and upload it to the directory. if it's not apache, you can't use it...
_________________________

My Hacks Page (will be back with UBB 7!)
UBBDev - We put the class into UBB.classic!

Top
#87772 - 06/23/03 10:12 AM Re: Stop hot linking of your images
1QuickSI Offline
Coder

Registered: 06/10/01
Posts: 705
Loc: CT
Nice LK. I'll be adding this thumbsup

For Windows you could use this:

http://www.nncron.ru/

For those that use *NIX and do not have access to CRON here is a solution for you as well.

http://www.smarterscripts.com/cron/

Remember .htacess is very powerful but if you mae a simple synactical mistake it will render your site from being able to be accessed and it is possible to send it in to an indefinite loop as well so be careful you do not make redundent inclusions. The full file name as it is just an extension and can be placed in any directory. Also the file should be uploaded in ASCii and by default works recursivly. The file should be chmoded to 644 so that it is not access able via a web browser which is also done by:

Code:
[/code]I also use .htaccess to direct to custom error pages:

[code]

_________________________
...Steven
Hostboard.com
Running UBB v6.1.0.4
Doing what NO other UBB in the world is doing.
The first & only production UBB powered by MySQL.

Top
#87773 - 06/23/03 10:21 AM Re: Stop hot linking of your images
LK Offline
Admin / Code Breaker

Registered: 03/24/01
Posts: 7396
yeah... in my hacks page, I use it for DirectoryIndex:
Code:
[/code]and for simply redirecting (in an inside directory):[code]

_________________________

My Hacks Page (will be back with UBB 7!)
UBBDev - We put the class into UBB.classic!

Top
#87774 - 06/23/03 10:58 AM Re: Stop hot linking of your images
1QuickSI Offline
Coder

Registered: 06/10/01
Posts: 705
Loc: CT
I know this has been mentioned many times in securing stuff like cp.cgi but thought since we are noting the many inclusions that it was worth mentioning again.

For restricting access to certain files I use:

This is placed in the directory you are trying to protect.

Code:
[/code].htpassword
This can be located anywhere on your server.
[code]

For further security I use .crypt so that the password is not readily leigable.
_________________________
...Steven
Hostboard.com
Running UBB v6.1.0.4
Doing what NO other UBB in the world is doing.
The first & only production UBB powered by MySQL.

Top
#87775 - 06/23/03 06:54 PM Re: Stop hot linking of your images
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25554
Loc: Texas
Quote:
quote:
Originally posted by 1QuickSI:
This replaces the linked image with one of your choosing.
[code][/code]In both examples replace YourDomain with either your domain or your hosts.
Would this one (I added the swf) be a good one to keep people from hotlinking your games files?
_________________________
- Allen wavey
- What Drives You?

Top
#87776 - 06/25/03 11:56 AM Re: Stop hot linking of your images
PF Offline
Member

Registered: 04/06/02
Posts: 97
Loc: the UK
[spam]
I wanted to know who was hotlinking to our files, and trawling through the logs was a pain.

I made a PHP script that uses PgSQL as storage, and is managed by a webpage, and at a glance you can see who's hotlinking to what, and allow or block domains. (By Default they get an image you set as the default, but blocking allows you to replace the image with something else, a 65Kx65K gif that one of our staff created is a favourite laugh )
It also gives stats on top hotlinkers etc...
Some piccies:
Main Page
Stats Page

Homepage for my little project is: here smile
[/spam]

LK's logging is pretty good for smallish sites, but when you're getting >150 hotlinking requests per day, that file is going to fill up pretty quickly, and managing it will become a pain. BTW, yep my script does use the .htaccess stuff. smile
_________________________
FFAddicts Forums - It's More Than A Game! It's A Religion!!

Top
#87777 - 06/25/03 12:37 PM Re: Stop hot linking of your images
LK Offline
Admin / Code Breaker

Registered: 03/24/01
Posts: 7396
Sounds really nice... too bad I don't know what PgSQL means, hence I won't register to your board (unless you tell me it's easy to transfer it to flat file), hence I can't check your code tipsy
_________________________

My Hacks Page (will be back with UBB 7!)
UBBDev - We put the class into UBB.classic!

Top
#87778 - 06/25/03 12:56 PM Re: Stop hot linking of your images
PF Offline
Member

Registered: 04/06/02
Posts: 97
Loc: the UK
PgSQL = PostgreSQL smile

~95% of the code is PHP, there's a few SQL statements in there in ahls_db_pgsql.php for data input and retrieval.
Not sure on how difficult a flat file "database" would be for it, sorting would probably be the biggest pain, since the main page sorts by Image then Date then Time. And then the stats need sorting too smile
Someone did say they'd work on a Flat File mod for me, but that hasn't came to be yet wink
_________________________
FFAddicts Forums - It's More Than A Game! It's A Religion!!

Top
#87779 - 06/25/03 02:55 PM Re: Stop hot linking of your images
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25554
Loc: Texas
yes, sounds good smile
_________________________
- Allen wavey
- What Drives You?

Top
#87780 - 06/29/03 03:24 AM Re: Stop hot linking of your images
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25554
Loc: Texas
Would this:
[code][/code]work to keep people from linking to my images except for the sites where I link to'em? I'm findin them all over the net mad
_________________________
- Allen wavey
- What Drives You?

Top
#87781 - 06/29/03 03:30 AM Re: Stop hot linking of your images
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25554
Loc: Texas
ok, I see what's happening.. they're linking to my old domain stand318.com which I've pointed to the new domain, which allows them to load and apparently bypass my htaccess file mad

http://www.stand318.com/ubb/graemlins/wavey.gif
_________________________
- Allen wavey
- What Drives You?

Top
#87782 - 06/29/03 11:00 AM Re: Stop hot linking of your images
PF Offline
Member

Registered: 04/06/02
Posts: 97
Loc: the UK
Allen, that can be reduced to this:
[code][/code](Plus I thought the Pipes in the RewriteRule were required. (Unless the UBB is removing them, I shall see once this is posted) smile
_________________________
FFAddicts Forums - It's More Than A Game! It's A Religion!!

Top
#87783 - 06/29/03 05:05 PM Re: Stop hot linking of your images
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25554
Loc: Texas
thank you smile

That should keep the new leechers away... I guess I'll have to replace the images they are linking to from the old domain, or just stop forwarding people from the old one to the new one smile
_________________________
- Allen wavey
- What Drives You?

Top
#87784 - 06/29/03 05:31 PM Re: Stop hot linking of your images
LK Offline
Admin / Code Breaker

Registered: 03/24/01
Posts: 7396
or if it's possible instead of forwarding www.stand318.com/images/whatever.gif to www.pj.org/images/whatever.gif, just forward it to www.pj.org... (without the inside directories)
_________________________

My Hacks Page (will be back with UBB 7!)
UBBDev - We put the class into UBB.classic!

Top
#87785 - 06/29/03 05:53 PM Re: Stop hot linking of your images
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25554
Loc: Texas
the stand318 domain is parked and pointed to the praisecafe.org domain. All links to stand318.com/blah goes automagically to praisecafe.org/blah

I unparked the domain for now... hopefully the ezboard eejits and open topic fruits will get the hint and use their own tipsy
_________________________
- Allen wavey
- What Drives You?

Top
#87786 - 06/30/03 05:41 AM Re: Stop hot linking of your images
PF Offline
Member

Registered: 04/06/02
Posts: 97
Loc: the UK
I've had a lot of success with getting ezBoard to remove the links to the images.
You can see their info on it here

Each time I've given them an Image to delink, they've usually done it within 24 hours.

Gone down from something like 20 ezBoard requests per day, down to about 1 every 3 days now. Been 2 months since I started that "campaign" though. smile
_________________________
FFAddicts Forums - It's More Than A Game! It's A Religion!!

Top
#87787 - 06/30/03 09:41 AM Re: Stop hot linking of your images
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25554
Loc: Texas
hmmm... for some reason the htaccess isn't working. you can see a banana.gif almost to the bottom of this page:
http://www.fragmere.com/community/users/ancient/rik/hgb/index.php

my cpanel has a place for htaccess construction to stop hotlinking and it seemed to say everything looked ok confused
_________________________
- Allen wavey
- What Drives You?

Top
Page 1 of 2 1 2 >


Moderator:  Gizmo, Ian_W 
Who's Online
0 registered (), 39 Guests and 16 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] [Pre-7.3] [Final] pJIRC Addon v0.5
by
07/30/06 10:42 PM
Newest Members
joshuasm02, Chosen, Vick, Bartman, Infinity Master
13496 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
13496 Members
59 Forums
37114 Topics
290378 Posts

Max Online: 686 @ 06/28/07 07:04 AM
Featured Member
Registered: 02/16/10
Posts: 1

 

 

 
fusionbb message board php hacks