Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: calisun on November 29, 2007, 02:42:14 AM

Title: People linking to images from my web site
Post by: calisun 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?
Title: Re: People linking to images from my web site
Post by: thomasch 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 (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
Title: Re: People linking to images from my web site
Post by: calisun on November 29, 2007, 07:21:58 AM
thomasch
Thank you for pointing me in the right direction.
Title: Re: People linking to images from my web site
Post by: cactus 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 (http://www.dagondesign.com/articles/hotlink-protection-with-htaccess/) 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 (http://mirror.contribs.org/contribs/gordonr/devguide/html/book1.htm), which is linked in the Documentation section of the wiki as well..
Title: Re: People linking to images from my web site
Post by: beakersloco 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.

Title: Re: People linking to images from my web site
Post by: nakor_au 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 :)
Title: Re: People linking to images from my web site
Post by: cactus 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.