Chris Nizzardini, Salt Lake City Utah, Web Developer Specializing in LAMP+Ajax Since 2006

My Blog

Here is my awesome blog. You can find information on programming, linux, documentation, tips for code and database optimization, my thoughts and rants, and whatever else I feel like sharing. Feel free to contribute to the blog by posting comments and asking questions.
Linux

linux debian apache2 installing mod-write

To install mod-rewrite in debian type a2enmod rewrite from the shell. You will the be asked to restart apache.

A simple mod-write script that blocks anyone from hotlinking to your images would look like this:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L]

You would either place this in an .htaccess file or if you have root access to the server in /etc/apache2/sites-available and then within the directory you want to protect from hotlinking.

Related posts:

  1. setting up ssl for apache2 on debian linux
  2. setup an easy ftp server on debian 3.1 linux
  3. vmware on debian 3.1 sarge
  4. setting up samba on debian 3.1
  5. Resize Images From Linux Shell using imagemagick

Leave a Reply