POV-Ray : Newsgroups : povray.off-topic : Question about an .htaccess file Server Time
11 Oct 2024 01:22:30 EDT (-0400)
  Question about an .htaccess file (Message 1 to 9 of 9)  
From: Dan Byers
Subject: Question about an .htaccess file
Date: 29 Jan 2008 12:40:00
Message: <web.479f6436e9f5c84da8d0b25a0@news.povray.org>
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


Post a reply to this message

From: Mike Raiford
Subject: Re: Question about an .htaccess file
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

From: Dan Byers
Subject: Re: Question about an .htaccess file
Date: 29 Jan 2008 13:15:00
Message: <web.479f6cb0354dba3ca8d0b25a0@news.povray.org>
Mike Raiford <mra### [at] hotmailcom> wrote:
> Try:
>
> RewriteRule .*\.(gif|jpg|png)$        -                       [G]
>

I'll give it a try -- thanks.

--
Dan
GoofyGraffix.com


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Question about an .htaccess file
Date: 29 Jan 2008 13:31:59
Message: <479f711f@news.povray.org>
.htaccess is bad for performance. It should only be used in shared hosts 
and the like. If you have full access to the server configuration 
(httpd.conf), set it so that it doesn't even try reading .htaccess 
files, and put your config in <Directory> tags on your httpd.conf.


Post a reply to this message

From: Dan Byers
Subject: Re: Question about an .htaccess file
Date: 29 Jan 2008 13:50:00
Message: <web.479f7478354dba3ca8d0b25a0@news.povray.org>
Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:
> .htaccess is bad for performance. It should only be used in shared hosts

It's a shared host.

--
Dan
GoofyGraffix.com


Post a reply to this message

From: Warp
Subject: Re: Question about an .htaccess file
Date: 30 Jan 2008 06:04:39
Message: <47a059c7@news.povray.org>
Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:
> .htaccess is bad for performance.

  So it takes 0.1 seconds instead of 0.01 seconds to evaluate for the
maximum 1 hit per minute he probably gets? Big deal?

-- 
                                                          - Warp


Post a reply to this message

From: Dan Byers
Subject: Re: Question about an .htaccess file
Date: 1 Feb 2008 09:25:00
Message: <web.47a32b74354dba3ca8d0b25a0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:

>   So it takes 0.1 seconds instead of 0.01 seconds to evaluate for the
> maximum 1 hit per minute he probably gets? Big deal?
>
> --
>                                                           - Warp

I'm getting one hit per minute??????  Holy crud, my traffic is spiking through
the roof!!!  My advertising dollars are finally paying off ;)

--
Dan
GoofyGraffix.com


Post a reply to this message

From: Invisible
Subject: Re: Question about an .htaccess file
Date: 1 Feb 2008 09:25:30
Message: <47a32bda$1@news.povray.org>
Dan Byers wrote:

> I'm getting one hit per minute??????  Holy crud, my traffic is spiking through
> the roof!!!  My advertising dollars are finally paying off ;)

I'll have whatever he's having...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Warp
Subject: Re: Question about an .htaccess file
Date: 1 Feb 2008 10:21:28
Message: <47a338f7@news.povray.org>
Dan Byers <goofygraffix_at_geemail_dot_com> wrote:
> >   So it takes 0.1 seconds instead of 0.01 seconds to evaluate for the
> > maximum 1 hit per minute he probably gets? Big deal?

> I'm getting one hit per minute??????  Holy crud, my traffic is spiking through
> the roof!!!  My advertising dollars are finally paying off ;)

  Well, I said "maximum". :P

-- 
                                                          - Warp


Post a reply to this message

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