View Single Post
Old 01-30-2005, 08:54 PM  
rowan
Too lazy to set a custom title
 
Join Date: Mar 2002
Location: Australia
Posts: 17,393
I've decided to post a free tip because hotlinking sucks... use this script to send back a 401 result (authentication failed/password required). This will pop up a password prompt.

<?php
$msg = "Visit www.mydomain.com for the real pics";
header("HTTP/1.0 401 authreq");
header("WWW-Authenticate: Basic realm=\"$msg\"");
die;
?>

Use your htaccess to redirect hotlinks to that script. Replace $msg with whatever text you want to appear in the password prompt box.

Enjoy.
rowan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote