Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

htaccess question

 
   Web Hosting Problem Solving Community! (Home) -> Webmaster RSS
Next:  webalizer with special log file format  
Author Message
geraldidontwan

External


Since: Jul 22, 2003
Posts: 39



(Msg. 1) Posted: Fri Jul 30, 2004 1:28 am
Post subject: htaccess question
Archived from groups: alt>www>webmaster (more info?)

Hi,

How do I get to write the following as one line?

RewriteCond %{HTTP_REFERER} !^http://images.google.co.uk/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.co.uk$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.com.au/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.google.co.jp/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.fr/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.at/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.de/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.nl/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.ca/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.se/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.pl/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.it/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.fi/.*$ [NC]

thanks for your help (I'm new to this)

Gerald

 >> Stay informed about: htaccess question 
Back to top
Login to vote
spam3

External


Since: Jul 01, 2003
Posts: 411



(Msg. 2) Posted: Fri Jul 30, 2004 1:28 am
Post subject: Re: htaccess question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Grytpype-Thynne wrote:

 > Hi,
 >
 > How do I get to write the following as one line?
 >
 > RewriteCond %{HTTP_REFERER} !^http://images.google.co.uk/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.co.uk$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.com.au/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://www.google.co.jp/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.fr/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.at/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.de/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.nl/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.ca/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.se/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.pl/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.it/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.fi/.*$ [NC]

*not* *tested*

RewriteCond %{HTTP_REFERER}
!^http://(images\.google\.(co\.uk|com\.au|fr|at|de|nl|ca|se|pl|it|fi)/?.*|www\.google\.co\.jp)$
[NC]

--
Justin Koivisto - spam.DeleteThis@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: htaccess question 
Back to top
Login to vote
lostinspace

External


Since: Jul 21, 2003
Posts: 52



(Msg. 3) Posted: Fri Jul 30, 2004 1:28 am
Post subject: Re: htaccess question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

----- Original Message -----
From: "Grytpype-Thynne" <>
Newsgroups: alt.www.webmaster
Sent: Thursday, July 29, 2004 5:28 PM
Subject: htaccess question


 > Hi,
 >
 > How do I get to write the following as one line?
 >
 > RewriteCond %{HTTP_REFERER} !^http://images.google.co.uk/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.co.uk$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.com.au/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://www.google.co.jp/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.fr/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.at/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.de/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.nl/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.ca/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.se/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.pl/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.it/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.fi/.*$ [NC]
 >
 > thanks for your help (I'm new to this)
 >
 > Gerald

This may work in your use.
I use it for something entirely different
RewriteCond %{HTTP_REFERER} ^http://.*\.[a-z]{2}/


BTW, Brucie your hopeless Wink))))
I rather enjoyed your response.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: htaccess question 
Back to top
Login to vote
spam19

External


Since: May 08, 2004
Posts: 953



(Msg. 4) Posted: Fri Jul 30, 2004 1:41 am
Post subject: Re: htaccess question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, 29 Jul 2004 21:48:00 GMT, Justin Koivisto <spam RemoveThis @koivi.com> wrote:

 > Grytpype-Thynne wrote:
 >
  >> Hi,
  >> How do I get to write the following as one line?
  >> RewriteCond %{HTTP_REFERER} !^http://images.google.co.uk/.*$ [NC]
  >> RewriteCond %{HTTP_REFERER} !^http://images.google.co.uk$ [NC]
  >> RewriteCond %{HTTP_REFERER} !^http://images.google.com.au/.*$ [NC]
  >> RewriteCond %{HTTP_REFERER} !^http://www.google.co.jp/.*$ [NC]
  >> RewriteCond %{HTTP_REFERER} !^http://images.google.fr/.*$ [NC]
  >> RewriteCond %{HTTP_REFERER} !^http://images.google.at/.*$ [NC]
  >> RewriteCond %{HTTP_REFERER} !^http://images.google.de/.*$ [NC]
  >> RewriteCond %{HTTP_REFERER} !^http://images.google.nl/.*$ [NC]
  >> RewriteCond %{HTTP_REFERER} !^http://images.google.ca/.*$ [NC]
  >> RewriteCond %{HTTP_REFERER} !^http://images.google.se/.*$ [NC]
  >> RewriteCond %{HTTP_REFERER} !^http://images.google.pl/.*$ [NC]
  >> RewriteCond %{HTTP_REFERER} !^http://images.google.it/.*$ [NC]
  >> RewriteCond %{HTTP_REFERER} !^http://images.google.fi/.*$ [NC]
 >
 > *not* *tested*
 >
 > RewriteCond %{HTTP_REFERER}
 > !^http://(images\.google\.(co\.uk|com\.au|fr|at|de|nl|ca|se|pl|it|fi)/?.*|www\.google\.co\.jp)$
 > [NC]
 >

That one <a style='text-decoration: underline;' href="http://www.google.co.jp" target="_blank">www.google.co.jp</a> sure makes a mess of it :/

It seems like you are setting up for a rule which applies if the request
*isn't* coming from images.google.(ad nauseum). It also looks like you
are *allowing* requests from images.google.com, is this correct? Then two
short rules can replace all of these:

RewriteCond %{HTTP_REFERER}
!^http://(images\.google\.|www\.google\.co\.jp) [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://images\.google\.com/.*$ [NC]

Note, if you just want to negate all referers from images.google.anything,
just use the first line without the ,OR. Like Justin's, not tested.

Grey

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollary that nothing is ridiculous.
- <a style='text-decoration: underline;' href="http://www.greywyvern.com/webslavent.php?msg=53" target="_blank">http://www.greywyvern.com/webslavent.php?msg=53</a> - Opera puffin mascot
campaign!<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: htaccess question 
Back to top
Login to vote
shit1

External


Since: Jul 09, 2004
Posts: 446



(Msg. 5) Posted: Fri Jul 30, 2004 10:34 am
Post subject: Re: htaccess question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

in post: <news:MPG.1b737c59d9856ace989781@news.individual.net>
Grytpype-Thynne <geraldIDONTWANTSPAMbramwell DeleteThis @hotmail.com> said:

 > Hi,

g'day

 > How do I get to write the following as one line?
 > RewriteCond %{HTTP_REFERER} !^http://images.google.co.uk/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.co.uk$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.com.au/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://www.google.co.jp/.*$ [NC]
 > RewriteCond %{HTTP_REFERER} !^http://images.google.fr/.*$ [NC]
 > [...]

<a style='text-decoration: underline;' href="http://moreshit.usenetshit.info/all-on-one-line-thingy.shit" target="_blank">http://moreshit.usenetshit.info/all-on-one-line-thingy.shit</a>

--
i h e a r v o i c e s<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: htaccess question 
Back to top
Login to vote
spamblocked1

External


Since: Sep 19, 2003
Posts: 3499



(Msg. 6) Posted: Fri Jul 30, 2004 10:34 am
Post subject: Re: htaccess question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

brucie wrote:
 > in post: <news:MPG.1b737c59d9856ace989781@news.individual.net>
 > Grytpype-Thynne <geraldIDONTWANTSPAMbramwell.TakeThisOut@hotmail.com> said:
 >
  >> How do I get to write the following as one line?
  >> ...
 >
<font color=purple> > <a style='text-decoration: underline;' href="http://moreshit.usenetshit.info/all-on-one-line-thingy.shit</font" target="_blank">http://moreshit.usenetshit.info/all-on-one-line-thingy.shit</font</a>>

beautiful, elegant in its simplicity and totally nonsensical - perfect.

--
William Tasso
Recommended reading ...
<a style='text-decoration: underline;' href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a>
<a style='text-decoration: underline;' href="http://www.aww-faq.org/" target="_blank">http://www.aww-faq.org/</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: htaccess question 
Back to top
Login to vote
geraldidontwan

External


Since: Jul 22, 2003
Posts: 39



(Msg. 7) Posted: Fri Jul 30, 2004 4:40 pm
Post subject: Re: htaccess question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <opsbxi3vvfsl6xfd.DeleteThis@greywyvern.mshome.net>, spam.DeleteThis@greywyvern.com
says...
 > On Thu, 29 Jul 2004 21:48:00 GMT, Justin Koivisto <spam.DeleteThis@koivi.com> wrote:
 >
  > > Grytpype-Thynne wrote:
  > >
   > >> Hi,
   > >> How do I get to write the following as one line?
   > >> RewriteCond %{HTTP_REFERER} !^http://images.google.co.uk/.*$ [NC]
   > >> RewriteCond %{HTTP_REFERER} !^http://images.google.co.uk$ [NC]
   > >> RewriteCond %{HTTP_REFERER} !^http://images.google.com.au/.*$ [NC]
   > >> RewriteCond %{HTTP_REFERER} !^http://www.google.co.jp/.*$ [NC]
   > >> RewriteCond %{HTTP_REFERER} !^http://images.google.fr/.*$ [NC]
   > >> RewriteCond %{HTTP_REFERER} !^http://images.google.at/.*$ [NC]
   > >> RewriteCond %{HTTP_REFERER} !^http://images.google.de/.*$ [NC]
   > >> RewriteCond %{HTTP_REFERER} !^http://images.google.nl/.*$ [NC]
   > >> RewriteCond %{HTTP_REFERER} !^http://images.google.ca/.*$ [NC]
   > >> RewriteCond %{HTTP_REFERER} !^http://images.google.se/.*$ [NC]
   > >> RewriteCond %{HTTP_REFERER} !^http://images.google.pl/.*$ [NC]
   > >> RewriteCond %{HTTP_REFERER} !^http://images.google.it/.*$ [NC]
   > >> RewriteCond %{HTTP_REFERER} !^http://images.google.fi/.*$ [NC]
  > >
  > > *not* *tested*
  > >
  > > RewriteCond %{HTTP_REFERER}
  > > !^http://(images\.google\.(co\.uk|com\.au|fr|at|de|nl|ca|se|pl|it|fi)/?.*|www\.google\.co\.jp)$
  > > [NC]
  > >
 >
 > That one <a style='text-decoration: underline;' href="http://www.google.co.jp" target="_blank">www.google.co.jp</a> sure makes a mess of it :/
 >
 > It seems like you are setting up for a rule which applies if the request
 > *isn't* coming from images.google.(ad nauseum). It also looks like you
 > are *allowing* requests from images.google.com, is this correct? Then two
 > short rules can replace all of these:
 >
 > RewriteCond %{HTTP_REFERER}
 > !^http://(images\.google\.|www\.google\.co\.jp) [NC,OR]
 > RewriteCond %{HTTP_REFERER} ^http://images\.google\.com/.*$ [NC]
 >
 > Note, if you just want to negate all referers from images.google.anything,
 > just use the first line without the ,OR. Like Justin's, not tested.
 >
 > Grey
 >
 >
Thanks Grey,

I have found quite a lot of my images were being hotlinked and so have
set up for a rewrite to a [F] but I have a number of sites that in the
past I have allowed to use banners from our server. I am in the process
of getting them to use the banners on their sites but I also want some of
the search engines to be able to see them, I just didn't realise there
were so many different Googles that I was getting a lot of lines.

Thanks again

Gerald<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: htaccess question 
Back to top
Login to vote
shit1

External


Since: Jul 09, 2004
Posts: 446



(Msg. 8) Posted: Fri Jul 30, 2004 11:10 pm
Post subject: Re: htaccess question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

in post: <news:opsbxi3vvfsl6xfd@greywyvern.mshome.net>
GreyWyvern <spam.TakeThisOut@greywyvern.com> said:

 > That one <a style='text-decoration: underline;' href="http://www.google.co.jp" target="_blank">www.google.co.jp</a> sure makes a mess of it :/

but the pressing question is why the OP is wasting their time with the
referer instead of using IPs which is the most reliable way to determine
if something is google or not. anyone can use google referers.

--
i h e a r v o i c e s<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: htaccess question 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
yet another HTACCESS question: hotlinking - hy, RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.nl/.*$ [NC] RewriteRule .*\.(jpg|gif|JPG|GIF)$ http://www.mydomain.nl/hotlink.gif [R,L] This prevents hotlinking (at least, for most browsers)...

Help with .htaccess and 404. - Hi, In my .htaccess I have ErrorDocument 404 /Error404php.php And it works fine, but how do I know what page the user was looking for and was not found? lately my logs show 100's of 404, (a lot more than usual), so I suspect it is my fault but without...

.htaccess help - Hi, I want to redirect any access to image files on my website to a corresponding php file. For example, any request from external site to the file http://myhost.com/myimage.jpg will be redirected to the file http://myhost/view.php?file=myimage.jpg. How...

htaccess help - Hi huys I usually design my sites using absolute paths. But then I have problems when I want to show my work to a client, and I upload everything to a secondary directory, ie: /temp1/ I know I can prevent all the linking mess using a htaccess file .. I....

htaccess redirects - Hi All I've scoured the net looking for an htaccess file with no luck. I'm really hoping someone will be able to assist me with this. I have a domain that was recently registered. It has a ton of links from other websites to subdomains on my domain. ...
   Web Hosting Problem Solving Community! (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]