Mod Rewrite - Verify Referer

I’m in need of a few lines for mod_rewrite, installed with Apache 2.0.59 and PHP 4.3.9.

I’m trying to verify a referer from our site so that downloads can’t be accessed without coming through our download.php.

I do not want a PHP script which does the referer check.

Any other requests should automatically be deflected to a 401 Not Authorized.

Any help in solving this would be greatly appreciated!