POV-Ray : Newsgroups : povray.off-topic : Question about an .htaccess file : Re: Question about an .htaccess file Server Time
10 Oct 2024 23:20:55 EDT (-0400)
  Re: Question about an .htaccess file  
From: Mike Raiford
Date: 29 Jan 2008 12:49:38
Message: <479f6732$1@news.povray.org>
Dan Byers wrote:
> I have this little bit of code in the .htaccess file in my /img directory on my
> website, the purpose of which is to keep people from hotlinking onto any GIF
> files (btw we're talking about Apache):
> 
> RewriteEngine on
> RewriteCond %{HTTP_REFERER} !^$
> RewriteCond %{HTTP_REFERER} !^http://mydomainname.com/.*$     [NC]
> RewriteCond %{HTTP_REFERER} !^http://www.mydomainname.com/.*$ [NC]
> RewriteRule .*\.gif$        -                       [G]
> 
> I would like to add the capability to prevent JPG or PNG hotlinking as well.
> Anyone know how to do that?  Do I copy everything from the first RewriteCond
> thru the [G], and just supply the new file type instead of .gif?  Any help
> would be appreciated.  Thanks :)
> 
> --
> Dan
> GoofyGraffix.com
> 
> 
> 

Try:

RewriteRule .*\.(gif|jpg|png)$        -                       [G]


(Disclaimer: I'm by no means an expert on MOD_REWRITE, if you webserver 
acts strangely after the suggested changes, don't blame me, you changed 
your file.)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.