Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Old 12-18-2006, 10:58 PM   #1 (permalink)
Junior Member
 
Join Date: 12-18-06
Posts: 10
iTrader: 0 / 0%
Latest Blog:
None

Ancodi is liked by many
Image Replacement help.

Ok, On a certain page of my website, there are 100 (99 excluding the banner) images. But, to avoid hotlinking, is there a way I can replace the image, if hotlinked, with another image saying "DON'T HOTLINK!" Kind of like the .co.nr button if you hotlink it. Or Tripod. Can you tell me simple please. Ta!
Ancodi is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-21-2006, 09:40 AM   #2 (permalink)
v7n Mentor
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,338
iTrader: 0 / 0%
Latest Blog:
Starting p90x today

Izzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web pro
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
Well, I know cPanel offers a simple option in there setup that allows you to do that very easily.

What kind of Control Panel do you have for your website?
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-21-2006, 02:02 PM   #3 (permalink)
Contributing Member
 
andheresjohnny's Avatar
 
Join Date: 07-12-06
Location: Michigan
Posts: 122
iTrader: 0 / 0%
Latest Blog:
None

andheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really nice
This can be accomplished via the .htaccess file.

Example:

Code:
RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?alloweddomain.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(www\.)?alloweddomain2.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(www\.)?alloweddomain3.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(.+)\.google.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(.+)\.googlebot.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(.+)\.msn.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(.+)\.msnbot.msn.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(.+)\.inktomisearch.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(.+)\.looksmart.com(/)?.*$ [NC] RewriteRule \.(gif|jpe?g|png|bmp)$ /images/embarrasingimage.gif [L,NC]


1. The following lines allow your domains to hotlink to the pictures (replace "alloweddomain", "alloweddomain2", etc ... with your domain names).

Code:
RewriteCond %{HTTP_REFERER} !^http://(www\.)?alloweddomain.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(www\.)?alloweddomain2.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(www\.)?alloweddomain3.com(/)?.*$ [NC]


2. The following lines allow the bots to get to your pictures.

Code:
RewriteCond %{HTTP_REFERER} !^http://(.+)\.google.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(.+)\.googlebot.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(.+)\.msn.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(.+)\.msnbot.msn.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(.+)\.inktomisearch.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(.+)\.looksmart.com(/)?.*$ [NC]


3. The following line says for all other domains, if someone tries to hotlink to a gif, jpe, jpg, png or bmp ... then replace that image with whatever you have stored at /images/embarrasingimage.gif.

Code:
RewriteRule \.(gif|jpe?g|png|bmp)$ /images/embarrasingimage.gif [L,NC]

I believe this is correct. Just place this code into your .htaccess in every root domain you want protected.
__________________
Watch Movies Online
Paid Surveys
andheresjohnny is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-22-2006, 12:29 PM   #4 (permalink)
v7n Mentor
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,338
iTrader: 0 / 0%
Latest Blog:
Starting p90x today

Izzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web pro
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
Wow.. cool, I never knew u could do that Thanks Johnny.
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-22-2006, 12:37 PM   #5 (permalink)
Contributing Member
 
andheresjohnny's Avatar
 
Join Date: 07-12-06
Location: Michigan
Posts: 122
iTrader: 0 / 0%
Latest Blog:
None

andheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really niceandheresjohnny is just really nice
Thanks.

I believe you can test it by accessing it via a proxy.

I had some sites hot-linking to some of my images and I did the same thing .. except instead of showing a substitue graphic I just deny the access outright.

ie; change the last line:

Code:
RewriteRule \.(gif|jpe?g|png|bmp)$ /images/embarrasingimage.gif [L,NC]
to:

Code:
RewriteRule .*\.(gif|jpe?g|png|bmp)$ [F,NC]

If you deny the access outright then you don't take a bandwidth hit. If you substitue a humiliating picture (or one with your url on it) then of course you will still use bandwidth.
__________________
Watch Movies Online
Paid Surveys
andheresjohnny is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
File name replacement Clark Web Design Lobby 3 08-11-2004 07:25 AM
Looking For Eryxma Replacement? vixen337 Web Hosting Forum 2 04-25-2004 06:15 PM
phpnuke replacement? jadzia Coding Forum 8 02-08-2004 12:55 AM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 10:13 AM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.