1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

RewriteCond %{REMOTE_ADDR} question ?

Discussion in 'Apache' started by Mudder, Jul 24, 2008.

  1. #1
    Hi there

    I want to apply a ReWrite rule to all visitors to a particular website EXCEPT certain ranges. E.g. the googlebot range.

    How do I specify a mask of /20 ? Or how do I specify the entire range of 66.249.64.0/20 ?

    Any assistance will be much appreciated.

    Regards

    Mudder
     
    Mudder, Jul 24, 2008 IP
  2. Mudder

    Mudder Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Perhaps if I show you the entry in my httpd.conf ? This example does not work. The IP checks are ignored... Perhaps someone cna spot why it doesn't work. The rewrite works fine. Its just the IP checking part that is ignored.

    <Directory "/opt/htdocs/stuff">
    Options +FollowSymLinks -Indexes
    AllowOverride All
    RewriteEngine on
    ### DO NOT DELETE
    RewriteCond %{REMOTE_ADDR} !^192\.168\.193\.[1-255]$
    RewriteCond %{REMOTE_ADDR} !^66\.249\.[64-79]\.[1-255]$
    RewriteRule ^images/corp/([^/]+)/([^/]+).pdf$ http://www.mydomain.co.za/docs/$1/$2.xml [L]
    ### End Force
    Order allow,deny
    Allow from all
    </Directory>
     
    Mudder, Jul 24, 2008 IP
  3. mr_inisibile

    mr_inisibile Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    just a word of warning. seems like you want to cloak content here. i have previously been busted for this by G and nullified all my hard work. they are pretty smart about their bots and the ips they use. there is no complete list of bots.

    i realize i wasn't answering your question but just thought i'd throw this in there.
     
    mr_inisibile, Jul 28, 2008 IP
  4. Mudder

    Mudder Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks. Appreciate the heads up.
     
    Mudder, Jul 29, 2008 IP
  5. forrie

    forrie Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I found this via a G search.

    The RewriteCond syntax below fails in Apache 2.0. I wonder if there is a change in the engine for Apache 2.2 ?

    I've been concerned with blocking a larger part of a network, EXCEPT 2 /24 portions, and I tried using the rules below and apache-2.0.x complains about the regex portion.




     
    forrie, Dec 12, 2008 IP