RewriteRule ain't working

software development


I’m trying to keep anyone from outside from linking directly to some pdf files below /documents; this traffic should instead be redirected to /documents.

I’m trying this in an .htaccess file:

RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain\.com/.*$ [NC] RewriteRule \.?(pdf)$ [R,L] but it’s not working at all. Am I close? Way off track? Hep a brother out here?



actually that does work so there it sits as an example for anyone else that would wanna do such a thing.