View Single Post
Old 01-30-2005, 09:14 PM  
DWB
Registered User
 
Industry Role:
Join Date: Jul 2003
Location: Encrypted. Access denied.
Posts: 31,779
Quote:
Originally Posted by rowan
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.
That's interesting.
DWB is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote