You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by CDitty <ma...@redhotsweeps.com> on 2002/02/09 03:25:46 UTC

htaccess problems

Hello all,

I am using the following htaccess file to keep people from using my 
graphics on their websites.  However, I have had several users from my site 
email me saying they can no longer see graphics on my site.  Anyone see 
anything wrong with this?

Thanks

Chris

AuthUserFile /dev/null
AuthGroupFile /dev/null
RewriteEngine On
RewriteOptions inherit
RewriteCond %{HTTP_REFERER} !^http://.*redhotsweeps.com/.*$ [NC]
RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$|.*[Pp][Nn][Gg]$ 
http://www.redhotsweeps.com/ [R,L]                              [F]




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: htaccess problems

Posted by Martin Haase-Thomas <mh...@meome-ag.de>.
funny RewriteRule :)
did you try out: (.*) http://www.redhotsweeps.com$! [T=image/*,R,L]

cheers
Martin

CDitty wrote:

> Hello all,
>
> I am using the following htaccess file to keep people from using my 
> graphics on their websites.  However, I have had several users from my 
> site email me saying they can no longer see graphics on my site.  
> Anyone see anything wrong with this?
>
> Thanks
>
> Chris
>
> AuthUserFile /dev/null
> AuthGroupFile /dev/null
> RewriteEngine On
> RewriteOptions inherit
> RewriteCond %{HTTP_REFERER} !^http://.*redhotsweeps.com/.*$ [NC]
> RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$|.*[Pp][Nn][Gg]$ 
> http://www.redhotsweeps.com/ [R,L]                              [F]
>
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: htaccess problems

Posted by CDitty <ma...@redhotsweeps.com>.
Thanks.  I'll look at those logs too.

Chris

At 10:31 AM 2/9/2002, you wrote:

>On Sat, 9 Feb 2002, CDitty wrote:
>
> > Thanks.  Something like this?  (I've never really been able to grasp this
> > stuff)
> >
> > RewriteEngine On
> > RewriteOptions inherit
> > RewriteCond %{HTTP_REFERER} !^http://.*redhotsweeps.com/.*$ [NC]
> > RewriteCond %{HTTP_REFERER} !^$ [NC]
> > RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$|.*[Pp][Nn][Gg]$
> > http://www.redhotsweeps.com/ [R,L]                              [F]
>
>Yes.
>
>I'm also not sure about your RewriteRule.  It doesn't look like a proper
>regular expression to me.  But if it works, it works.
>
>My guess would be more along the lines:
>RewriteRule .*\.(jpg|gif|png)$ http://www.redhotsweeps.com/ [R,L,NC]
>
>As I said, the only way to really figure out what is going on is to make
>use of your log files (extended/combined access_log plus rewritelog).
>
>Joshua.
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: htaccess problems

Posted by Joshua Slive <jo...@slive.ca>.
On Sat, 9 Feb 2002, CDitty wrote:

> Thanks.  Something like this?  (I've never really been able to grasp this
> stuff)
>
> RewriteEngine On
> RewriteOptions inherit
> RewriteCond %{HTTP_REFERER} !^http://.*redhotsweeps.com/.*$ [NC]
> RewriteCond %{HTTP_REFERER} !^$ [NC]
> RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$|.*[Pp][Nn][Gg]$
> http://www.redhotsweeps.com/ [R,L]                              [F]

Yes.

I'm also not sure about your RewriteRule.  It doesn't look like a proper
regular expression to me.  But if it works, it works.

My guess would be more along the lines:
RewriteRule .*\.(jpg|gif|png)$ http://www.redhotsweeps.com/ [R,L,NC]

As I said, the only way to really figure out what is going on is to make
use of your log files (extended/combined access_log plus rewritelog).

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: htaccess problems

Posted by CDitty <ma...@redhotsweeps.com>.
Thanks.  Something like this?  (I've never really been able to grasp this 
stuff)

RewriteEngine On
RewriteOptions inherit
RewriteCond %{HTTP_REFERER} !^http://.*redhotsweeps.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$|.*[Pp][Nn][Gg]$
http://www.redhotsweeps.com/ [R,L]                              [F]

At 10:16 AM 2/9/2002, you wrote:

> > AuthUserFile /dev/null
> > AuthGroupFile /dev/null
>
>Unnecessary.
>
> > RewriteEngine On
> > RewriteOptions inherit
> > RewriteCond %{HTTP_REFERER} !^http://.*redhotsweeps.com/.*$ [NC]
> > RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$|.*[Pp][Nn][Gg]$
> > http://www.redhotsweeps.com/ [R,L]                              [F]
>
>You need to check your log files to see what referer these particular
>clients are sending.  It is possible the client is not sending correct
>referers, or it is possible that your Rewrite rules are off.
>
>In general, to be safe, I would include an additional
>RewriteCond %{HTTP_REFERER} !^$
>in order to allow through browsers that send no Referer header.
>
>Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: htaccess problems

Posted by Joshua Slive <jo...@slive.ca>.
On Fri, 8 Feb 2002, CDitty wrote:

> Hello all,
>
> I am using the following htaccess file to keep people from using my
> graphics on their websites.  However, I have had several users from my site
> email me saying they can no longer see graphics on my site.  Anyone see
> anything wrong with this?
>
> Thanks
>
> Chris
>
> AuthUserFile /dev/null
> AuthGroupFile /dev/null

Unnecessary.

> RewriteEngine On
> RewriteOptions inherit
> RewriteCond %{HTTP_REFERER} !^http://.*redhotsweeps.com/.*$ [NC]
> RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$|.*[Pp][Nn][Gg]$
> http://www.redhotsweeps.com/ [R,L]                              [F]

You need to check your log files to see what referer these particular
clients are sending.  It is possible the client is not sending correct
referers, or it is possible that your Rewrite rules are off.

In general, to be safe, I would include an additional
RewriteCond %{HTTP_REFERER} !^$
in order to allow through browsers that send no Referer header.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org