Htaccess problem


Can someone please download this zip file containing a htaccess file i created and tell me if its done correctly?

I have set up a free site to test my htaccess file to prevent hotlinking but for some reason cant get it to work. I placed the htaccess file in my main directory (the one where you see the logs folder) and also in my folder. my free site url is and i am hotlinking an image of a girls face but you should see a image saying “hot linking image” Thanks.


I call BS =)

First of all, .htaccess doesn’t belong in main directory (aka home directory). Belongs in the Web Directory (ie /home/username/ or a subdirectory thereof (ie /home/username/

So you’d think it would work since you have a copy in your Web Directory. Well, depends on whether or not you got the right .htaccess file uploaded. Apparently you don’t - the “Hotlinking Image” doesn’t appear because instead of what you have in the zip file, you probably have this instead on the server:

RewriteEngine On RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?*$ [NC] RewriteRule \.(gif|jpg)$ - [F]Or something like it. One can tell because instead of being told to access hotlink.jpg instead of “side image 1.jpg”, the browser is being told that access to “side image 1.jpg” is forbidden. The [F] flag tells Apache to tell the browser access is forbidden.

:cool: Perl / MySQL / HTML+CSS