Gossamer Forum
Home : General : Internet Technologies :

Rewrite to restrict HTTP_REFERER to a specific file for a directory.

Quote Reply
Rewrite to restrict HTTP_REFERER to a specific file for a directory.
Here is my problem.

I want to restrict access to all pdf file in a particular directory where I am placing the .htaccess file to only be referred to by a particular file.

Here is what I have (which gives me an error 500 message):

Options -Indexes RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://www.myhost.ca/tempdir/adviso.*$ [NC] RewriteRule .*\.pdf$ - [F]

Any help would be greatly appreaciated.

Thanks.