htaccess proxyserver sperren

Allgemeiner Support für das kostenlose Toplisten Script Top Xl

Moderator:Paddelberg

Antworten
franco
Beiträge:8
Registriert:Freitag 18. Januar 2008, 16:02
htaccess proxyserver sperren

Beitrag von franco » Samstag 26. Januar 2008, 20:37

Hallo! Ich habe ein Problem. Die Liste wurde sofort bei Google aufgenommen, aber leider nicht mit meiner Domain, sondern von einem Proxy kopiert. Bei Abakus habe ich folgenden code, offenbar für die htaccess gefunden.

Code: Alles auswählen

order deny,allow
deny from 64.72.116.208 #Proxy-tylerschnaidt.com
habe aber Bedenken, dass ich mir die Zugänge lahmlegen könnte.

Dann habe ich noch einen PHP code gefunden. Weiß jemand Rat?

Gruß

Franco

Code: Alles auswählen

1.
      <?php
   2.
      // if "googlebot" is present in the user agent string
   3.
      if ( eregi('googlebot', $_SERVER['HTTP_USER_AGENT']) )
   4.
      {
   5.
        // get IP address, for example 66.249.66.1
   6.
        $ip = $_SERVER['REMOTE_ADDR'];
   7.
       
   8.
        // get hostname, for example crawl-66-249-66-1.googlebot.com
   9.
        $hostname = gethostbyaddr($ip);
  10.
       
  11.
        // get IP address from $hostname, for example 66.249.66.1
  12.
        $host = gethostbyname($hostname);
  13.
       
  14.
        // if "googlebot" is present in $hostname (which it should be)
  15.
        if ( eregi('Googlebot', $hostname) )
  16.
       {
  17.
          // if the IP addresses $ip and $host don't match
  18.
          if ($host != $ip) {
  19.
             // spoof Googlebot so don't let it in
  20.
             header('HTTP/1.0 403 Forbidden');
  21.
             echo 'Nothing to see here';
  22.
             exit();
  23.
           }
  24.
       } else {
  25.
         // again a spoof so don't let it in
  26.
         header('HTTP/1.0 403 Forbidden');
  27.
         echo 'Nothing to see here';
  28.
         exit();
  29.
       }
  30.
      }
  31.
       
  32.
      ?>

Benutzeravatar
Paddelberg
Site Admin
Beiträge:925
Registriert:Dienstag 17. Januar 2006, 00:02
Wohnort:Worms

Beitrag von Paddelberg » Samstag 26. Januar 2008, 22:20

Hi
der erste Code (.htaccess) sperrt den Zugriff von der ip 64.72.116.208
also, nur wenn jemand über diese ipß kommt, kommt Zugriff verboten. Alle anderen könne die Seite uneigeschränkt sehen

Der Php Code enttarnt User Agents, die sich als GoogleBot tarnen.

wenn du den Proxy sperren möchtest, wird das über die htaccess am besten gehen. Du musst halt die ip Adresse des Poxys kennen

mfg
simon

franco
Beiträge:8
Registriert:Freitag 18. Januar 2008, 16:02

Danke funktioniert aber nicht

Beitrag von franco » Sonntag 27. Januar 2008, 00:10

Hi Simon,

die IP hab ich aus dem Abakus Forum und in der Whois kontrolliert.

Hab in der htaccess unter die Admindaten (mit einer Leertaste) den Sperrcode eingegeben, und hochgeladen, dann hab ich den Sperrcode wieder entfernt, weil ich eine Idee hatte.

Dann habe die Einträge gesperrt und die Metas entfernt und hochgeladen. Die Änderungen wurden sofort vom Proxy übernommen.

Dann habe ich die htaccess mit Sperre hochgeladen. und was geändert.

Leider wurde die Änderung wieder vom Proxy sofort übernommen.

Bleibt wohl nur noch die Einträge und Metas zu ändern und ohne www. neu hochzuladen.

Gruß Franco

franco
Beiträge:8
Registriert:Freitag 18. Januar 2008, 16:02

Nachtrag Erklärung zum Script

Beitrag von franco » Sonntag 27. Januar 2008, 00:20

Hi Simon,

das war die Erklärung zum Script.

Proxy hijacking is a real pain to have to deal with. DMCA complaints, or emails to the hosting company often won't work because the proxy site isn't storing your content on their site - they're just the go between, fetching your page and delivering it to the user.

Robots.txt won't do anything because proxy sites aren't search engine crawlers and they don't take any notice of robots.txt -- the same as anyone viewing your site from their browser isn't affected by it (or for that matter crawlers that choose to ignore it).

From what I've read on the subject, the most reliable method of preventing the situation arising in the first place is to use a reverse DNS lookup. Most proxy sites will pass the user agent string intact, so if it's Googlebot requesting the page on your site via a proxy then Googlebot will still be listed as the User Agent. What will change will be the IP address (now that of the proxy server) which won't be that of Google.


If you do implement this then be sure to keep checking to make sure that you don't ban the genuine Googlebot by accident!!! My code comes with no guarantees and you implement it at your own risk.

With this method you should prevent most cases of proxy hijacking. For those proxy sites that don't pass on the User Agent you will need to individually block them (and unfortunately their normal users) via the proxy site's IP address.

This won't stop people accessing your site via a proxy altogether, but it will stop Google indexing your content fetched via a proxy.

Benutzeravatar
Paddelberg
Site Admin
Beiträge:925
Registriert:Dienstag 17. Januar 2006, 00:02
Wohnort:Worms

Beitrag von Paddelberg » Sonntag 27. Januar 2008, 16:06

Jo, wie oben erwähnt.
Mit dem Prob, das viele Proxys den Useragent etc entfernen.
Der Code bringt dir also nur was, wenn der Proxy so brav ist, den Useragent nicht zu entfernen.

Ich habe mir den proxy mal näher angeschaut
In deinem Fall würde der Php Code auch helfen!

mfg
simon

Antworten