Koozali.org: home of the SME Server

People linking to images from my web site

Offline calisun

  • *
  • 620
  • +0/-1
People linking to images from my web site
« on: November 29, 2007, 02:42:14 AM »
Does anybody know how to prevent people linking to images on my web site? I know some web sites will give you a massage in a linked image box "Linking is not allowed from www.domain.zzz, click here to see the image" Once people click on the link, they are brought to the original web site to see the image.
Is SME server capable of something like this, or is there a contrib for that?
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline thomasch

  • *
  • 232
  • +0/-0
Re: People linking to images from my web site
« Reply #1 on: November 29, 2007, 03:49:23 AM »
Does anybody know how to prevent people linking to images on my web site? I know some web sites will give you a massage in a linked image box "Linking is not allowed from www.domain.zzz, click here to see the image" Once people click on the link, they are brought to the original web site to see the image.
Is SME server capable of something like this, or is there a contrib for that?

There are many ways to prevent people linking to images/files/article on your web site (it's called "hot linking")

What I can tell you are there are many many techniques to prevent hotlinking.
Some that I know are using http-referer header, browser cookies, dynamic session identifiers and dynamic link manipulation.

However in an Apache httpd server preventing hotlinking involving .htaccess rules and mod_rewrite and use some php script.

SME server uses apache, have php, mod_rewrite capable, and you can use htaccess if you enable it because htaccess is disabled on SME by default.. read this wiki : http://wiki.contribs.org/Htaccess
so, SME is very capable to do hot link preventing.. but the ball is on your hand webmasters!

no, no contrib yet AFAIK

Offline calisun

  • *
  • 620
  • +0/-1
Re: People linking to images from my web site
« Reply #2 on: November 29, 2007, 07:21:58 AM »
thomasch
Thank you for pointing me in the right direction.
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: People linking to images from my web site
« Reply #3 on: November 29, 2007, 07:38:49 AM »
Does anybody know how to prevent people linking to images on my web site? I know some web sites will give you a massage in a linked image box "Linking is not allowed from www.domain.zzz, click here to see the image" Once people click on the link, they are brought to the original web site to see the image.
Is SME server capable of something like this, or is there a contrib for that?
This howto describes what steps you need to take pretty clear. To make changes on SME Server be sure to modify or create new template fragments, more information on the template system can be found in the SME Server's Development Guide, which is linked in the Documentation section of the wiki as well..
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline beakersloco

  • ****
  • 142
  • +0/-0
Re: People linking to images from my web site
« Reply #4 on: January 26, 2008, 02:44:10 AM »
I find that using the AWstats contrib and then finding the offenders and then renaming/replacing the file they linked to with something else is more fun. Then sit back and see how long it takes them to remove the link.

All that's necessary for the forces of evil to win in the world is for enough good men to do nothing.???" Edmund Burke -Irish orator, philosopher, & politician


For the battle is not yours, but God's.   2 Chronicles 20:15

Offline nakor_au

  • *
  • 18
  • +0/-0
Re: People linking to images from my web site
« Reply #5 on: January 26, 2008, 06:49:42 AM »
I find that using the AWstats contrib and then finding the offenders and then renaming/replacing the file they linked to with something else is more fun. Then sit back and see how long it takes them to remove the link.

thats evil and i like it :)

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: People linking to images from my web site
« Reply #6 on: January 26, 2008, 09:47:13 AM »
I find that using the AWstats contrib and then finding the offenders and then renaming/replacing the file they linked to with something else is more fun. Then sit back and see how long it takes them to remove the link.
Is is called hotlinking, do a search on Google about hotlinking and apache and you will find stuff like this: http://www.webmasterstop.com/62.html

Mod-rewrite is already available and enabled on every SME Server by default, you only need to use the template system to modify the configuration file with the proper RewriteRules for all servernames generated by SME Server. At the moment I do not have the time to generate the code for you, but you can find out how the template system works by reading the SME Server Developers Guide linked in the wiki.

A warning do not edit the template fragments in the /etc/e-smith/templates tree, make a copy of the needed section and create it's layout in the /etc/e-smith/templates-custom/ tree and make your changes in that copy, this way you can easily revert to the original settings later or when things go wrong by removing the fragment that causes the error. Above that the template system makes sure changes are kept over updates, reboots and modifying your server settings.

The code that generates the hostnames can be found in /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/. It concerns two files: 02ServerName and 03ServerAlias, You need to add your template after (or alter) the 26RewriteTrackAndTrace as this is responsible for the enabling the RewriteEngine and setting the RewriteRules, also make sure the rules do not conflict with the ones set in 27ManagerProxyPass as this will severely limit your functionality off the server since you will most likely unable to access your server-manager and other resources like the user-password page.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)