<?php
$linkr = '/404.php';
$navr = '404';
$linkf=urldecode($_SERVER['REQUEST_URI']);
$argu = $_SERVER['HTTP_USER_AGENT'];

// Google Elefantenalzheimer für die dauerhafte PHP-Weiterleitung mit Statuscode 301 sowie bad-bot-filter - lima server schonend, da kein 301 in der .htacess
// Alle Fehler umleiten in .htacess auf "ErrorDocument 404 /301.php"
// Fehlerseite 404.php erstellen mit auf noindex

// webspam und wilde bad bots umleiten
// http://iqoption-spam.clan.rip/fehlermeldung.php mit dummen Spam anlegen und diese auf noindex setzen
// in der .htacess CheckSpelling Off

// 1. Tea Time Filter
// in der .htacess die Start php auf "DirectoryIndex index0.php" in dieser erfolgt eine Weiterleitung auf "index#.php" der dumme bot kommt dann mit "index.ph" daher
// in der robots.txt Zugriff auf "wp-login" verbieten (bot Falle)
// typische dumm Suche...
if ('/index.ph'== $linkf) { $navr = '418'; }
if (strpos($linkf, 'wp-') !== false) { $navr = '418'; }
if (strpos($linkf, 'status') !== false) { $navr = '418'; }
if (strpos($linkf, 'admin') !== false) { $navr = '418'; }
if (strpos($linkf, 'connect') !== false) { $navr = '418'; }
if (strpos($linkf, 'statistics') !== false) { $navr = '418'; }
if (strpos($linkf, 'post') !== false) { $navr = '418'; }
if (strpos($linkf, 'login') !== false) { $navr = '418'; }
if (strpos($linkf, 'configuration') !== false) { $navr = '418'; }
if (strpos($linkf, 'CONFIGURATION') !== false) { $navr = '418'; }
if (strpos($linkf, 'img/') !== false) { $navr = '418'; }
if (strpos($linkf, 'includes') !== false) { $navr = '418'; }
if (strpos($linkf, 'statistics') !== false) { $navr = '418'; }
if (strpos($linkf, 'theme') !== false) { $navr = '418'; }
if (strpos($linkf, 'captcha') !== false) { $navr = '418'; }
if (strpos($linkf, 'main') !== false) { $navr = '418'; }
if (strpos($linkf, 'page') !== false) { $navr = '418'; }
if (strpos($linkf, 'favicon') !== false) { $navr = '418'; }
if (strpos($linkf, 'management') !== false) { $navr = '418'; }
if (strpos($linkf, 'back') !== false) { $navr = '418'; }
if (strpos($linkf, 'security') !== false) { $navr = '418'; }
if (strpos($linkf, 'header') !== false) { $navr = '418'; }
if (strpos($linkf, 'upload') !== false) { $navr = '418'; }
if (strpos($linkf, 'vendor') !== false) { $navr = '418'; }
if (strpos($linkf, 'run') !== false) { $navr = '418'; }
if (strpos($linkf, 'logout') !== false) { $navr = '418'; }
if (strpos($linkf, 'content') !== false) { $navr = '418'; }
if (strpos($linkf, 'config') !== false) { $navr = '418'; }
if (strpos($linkf, 'command') !== false) { $navr = '418'; }
if (strpos($linkf, 'database') !== false) { $navr = '418'; }
if (strpos($linkf, 'android') !== false) { $navr = '418'; }
if (strpos($linkf, 'reset') !== false) { $navr = '418'; }
if (strpos($linkf, 'script') !== false) { $navr = '418'; }
if (strpos($linkf, 'theme') !== false) { $navr = '418'; }
if (strpos($linkf, 'wordpress') !== false) { $navr = '418'; }
if (strpos($linkf, 'test') !== false) { $navr = '418'; }
if (strpos($linkf, 'googlead') !== false) { $navr = '418'; }
if (strpos($linkf, 'HEAD') !== false) { $navr = '418'; }
if (strpos($linkf, 'connectors') !== false) { $navr = '418'; }
if (strpos($linkf, 'administrator') !== false) { $navr = '418'; }
if (strpos($linkf, 'tiki-calendar') !== false) { $navr = '418'; }
if (strpos($linkf, 'elfinder') !== false) { $navr = '418'; }
if (strpos($linkf, 'password') !== false) { $navr = '418'; }
if (strpos($linkf, 'xmlrpc') !== false) { $navr = '418'; }



// Erst einmal die Vollsperrung durch die .htacess da der Bot sich nicht durch den User AGENT mit einer url autentifiziert hat und schon gleich mit verdächtigen Wörtern gesucht hatte.
if ($navr== "418")
{

if (strpos($argu, 'http') !== false) {


$_url = "https://www.autonomes-trading.de/htaccess_orginal.txt";
$_current_ht = file_get_contents($_url);

$dataFile = './.htaccess';
$line = "order allow,deny" . "\n" . "deny from " . $_SERVER['REMOTE_ADDR'] . "\n" . "Allow from All" . "\n" . $_current_ht;
$fileHandle = fopen($dataFile, 'w');
if (!fwrite($fileHandle, $line)) {
$error = 'Could not write to file, try again.';
}
fclose($fileHandle);

}
}

// 2. Filter 300 Typische User Eingabefehler Multiple Choces
if (strpos($linkf, 'kontakt' ) !== false) { $linkr = '/kontakt.html'; $navr = '300';}
// if (strpos($linkf, 'index' ) !== false) { $linkr = '/index.php'; $navr = '300';}
if (strpos($linkf, 'impressum' ) !== false) { $linkr = '/impressum.html'; $navr = '300';}
if (strpos($linkf, 'haftungsausschluss' ) !== false) { $linkr = '/haftungsausschluss.html'; $navr = '300';}
if (strpos($linkf, 'fragen' ) !== false) { $linkr = '/fragen.html'; $navr = '300';}
if (strpos($linkf, 'follow' ) !== false) { $linkr = '/follow-me.php'; $navr = '300';}
if (strpos($linkf, 'blog' ) !== false) { $linkr = '/blog.php'; $navr = '300';}
if (strpos($linkf, 'aktuelle' ) !== false) { $linkr = '/aktuelles.php'; $navr = '300';}
if (strpos($linkf, 'administration' ) !== false) { $linkr = '/administration.html'; $navr = '300';}
if (strpos($linkf, 'impressum' ) !== false) { $linkr = '/impressum.html'; $navr = '300';}
if (strpos($linkf, 'gaestebuch' ) !== false) { $linkr = '/gaestebuch.php'; $navr = '300';}
if (strpos($linkf, 'suche' ) !== false) { $linkr = '/suche.html'; $navr = '300';}
if (strpos($linkf, 'terminator' ) !== false) { $linkr = '/terminator.html'; $navr = '300';}
if (strpos($linkf, 'fundamental' ) !== false) { $linkr = '/fundamental.html'; $navr = '300';}
if (strpos($linkf, 'saisonal' ) !== false) { $linkr = '/saisonal.html'; $navr = '300';}
if (strpos($linkf, 'multi' ) !== false) { $linkr = '/multi.html'; $navr = '300';}
if (strpos($linkf, 'bestof' ) !== false) { $linkr = '/bestof3.html'; $navr = '300';}
if (strpos($linkf, 'wiki' ) !== false) { $linkr = '/boersen-wiki.php'; $navr = '300'; }



// 3.1 Filter 301 reguläre einzelne und überholte URL für den Crowler dauerhaft umleiten.
if ('/FACTSHEET_FS.htm' == $linkf) { $linkr = '/fundamental.html';$navr = '301';}
if ('/FACTSHEET_TS.htm' == $linkf) { $linkr = '/multi.html';$navr = '301';}
if ('/FACTSHEET_MS.htm' == $linkf) { $linkr = '/multi.html';$navr = '301';}
if ('/FACTSHEET_MS2.htm' == $linkf) { $linkr = '/multi.html';$navr = '301';}
if ('/FACTSHEET_NS.htm' == $linkf) { $linkr = '/neuronal.html';$navr = '301';}
if ('/FACTSHEET_BO.htm' == $linkf) { $linkr = '/bestof3.html';$navr = '301';}
if ('/FACTSHEET_BS.htm' == $linkf) { $linkr = '/behavioral.html';$navr = '301';}
if ('/FACTSHEET_SA.htm' == $linkf) { $linkr = '/saisonal.html';$navr = '301';}
if ('/FACTSHEET_GO.htm' == $linkf) { $linkr = '/trend.html';$navr = '301';}
if ('/FACTSHEET.htm' == $linkf) { $linkr = '/system-beschreibung.html';$navr = '301';}
if ('/factsheets.htm' == $linkf) { $linkr = '/system-beschreibung.html';$navr = '301';}
if ('/factsheets.html' == $linkf) { $linkr = '/system-beschreibung.html';$navr = '301';}
if ('/factsheet.html' == $linkf) { $linkr = '/system-beschreibung.html';$navr = '301';}
if ('/blog.html' == $linkf) { $linkr = '/blog.php';$navr = '301';}
if ('/BLOG.html' == $linkf) { $linkr = '/blog.php';$navr = '301';}
if ('/blog/' == $linkf) { $linkr = '/blog.php';$navr = '301';}
if ('/guestbook.php' == $linkf) { $linkr = '/gaestebuch.php';$navr = '301';}
if ('/GAESTE.htm' == $linkf) { $linkr = '/gaestebuch.php';$navr = '301';}
if ('/AKTUELL.htm' == $linkf) { $linkr = '/aktuelles.php';$navr = '301';}
if ('/system.html' == $linkf) { $linkr = '/die-systeme.html';$navr = '301';}
if ('/SYSTEM.htm' == $linkf) { $linkr = '/die-systeme.html';$navr = '301';}
if ('/major.html' == $linkf) { $linkr = '/major-server.php';$navr = '301';}
if ('/Aktuell_Text.htm' == $linkf) { $linkr = '/aktuelles.php';$navr = '301';}
if ('/FRAGEN.htm' == $linkf) { $linkr = '/fragen.html';$navr = '301';}
if ('/impressum' == $linkf) { $linkr = '/impressum.html';$navr = '301';}
if ('/IMPRESSUM.htm' == $linkf) { $linkr = '/impressum.html';$navr = '301';}
if ('/DAX.html' == $linkf) { $linkr = '/dax.html';$navr = '301';}
if ('/INFO.htm' == $linkf) { $linkr = '/info.html';$navr = '301';}
if ('/info-01.html' == $linkf) { $linkr = '/info.html';$navr = '301';}
if ('/KONTAKT.html' == $linkf) { $linkr = '/kontakt.html';$navr = '301';}
if ('/Anlageuni.htm' == $linkf) { $linkr = '/anlageunsiversum.html';$navr = '301';}
if ('/SIGNAL.htm' == $linkf) { $linkr = '/major-server.php';$navr = '301';}
if ('/Impressum_Text.html' == $linkf) { $linkr = '/impressum.html';$navr = '301';}
if ('/UEBERMICH.htm' == $linkf) { $linkr = '/ueber-mich.html';$navr = '301';}
if ('/Regel.htm' == $linkf) { $linkr = '/regeln.html';$navr = '301';}
if ('/guestbook/' == $linkf) { $linkr = '/gaestebuch.php';$navr = '301';}
if ('/Link.htm' == $linkf) { $linkr = '/boersenlink.html';$navr = '301';}
if ('/formular.htm' == $linkf) { $linkr = '/kontakt.html';$navr = '301';}
if ('/guestbookX/guestbook.php' == $linkf) { $linkr = '/gaestebuch.php';$navr = '301';}
if ('/aktuelles/iq-option-spam-webseiten.html' == $linkf) { $linkr = '/aktuelles/achtung-binaere-optionen.html';$navr = '301';}
if ('/neues-von-google.html' == $linkf) { $linkr = '/aktuelles/neues-von-google.html';$navr = '301';}
if ('/neues_2017.html' == $linkf) { $linkr = '/aktuelles/neues_2017.html';$navr = '301';}
if ('/top-trading-seite.html' == $linkf) { $linkr = '/aktuelles/top-trading-seite.html';$navr = '301';}
if ('/singalx.php?p=Signal12' == $linkf) { $linkr = '/signalx.php?p=Signal12';$navr = '301';}
if ('/singalx.php?p=Signal33' == $linkf) { $linkr = '/signalx.php?p=Signal33';$navr = '301';}
if ('/Suche.html' == $linkf) { $linkr = '/suche.html';$navr = '301';}
if ('/formular.html' == $linkf) { $linkr = '/kontakt.html';$navr = '301';}
if ('/orchestra.html' == $linkf) { $linkr = '/terminator.html';$navr = '301';}
if ('/DAX.html' == $linkf) { $linkr = '/dax.html';$navr = '301';}
if ('/INFO.htm' == $linkf) { $linkr = '/info.html';$navr = '301';}
if ('/IMPRESSUM.htm' == $linkf) { $linkr = '/impressum.html';$navr = '301';}
if ('/contact-us' == $linkf) { $linkr = '/kontakt.html';$navr = '301';}


// 3.2 Filter 410 reguläre einzelne und überholte URL für den Crowler gerecht entwerten.
if ('/Boersenspruch.php' == $linkf) { $navr = '410'; }
if ('/counter/counter.php' == $linkf) { $navr = '410'; }
if ('/12345.php' == $linkf) { $navr = '410'; }
if ('/START.php' == $linkf) { $navr = '410'; }
if ('/START.html' == $linkf) { $navr = '410'; }
if ('/m/' == $linkf) { $navr = '410'; }
if ('/Kursabfrage_.php' == $linkf) { $navr = '410'; }
if ('/start.html' == $linkf) { $navr = '410'; }
if ('/start.php' == $linkf) { $navr = '410'; }
if ('/index.html' == $linkf) { $navr = '410'; }
if ('/site/autonomestrading/contact-us'== $linkf) { $navr = '410'; }
if ('/404.html' == $linkf) { $navr = '410'; }
if ('/301.php' == $linkf) { $navr = '410'; }
if ('/Startl_Text.htm' == $linkf) { $navr = '410'; }
if ('/word.html' == $linkf) { $navr = '410'; }
if ('/wort-spiel.html' == $linkf) { $navr = '410'; }
if ('/download/files/Public/MT4/' == $linkf) { $navr = '410'; }
if ('/download/files/Public/XLS/' == $linkf) { $navr = '410'; }
if ('/download/files/Public/' == $linkf) { $navr = '410'; }
if ('/download/files/' == $linkf) { $navr = '410'; }
if ('/download.htmlLevermann.xls' == $linkf) { $navr = '410'; }
if ('/404.html' == $linkf) { $navr = '410'; }
if ('/301.php' == $linkf) { $navr = '410'; }
if ('/home' == $linkf) { $navr = '410'; }
if ('/clients/resources/Yahoo.xls' == $linkf) { $navr = '410'; }
if ('/start.php' == $linkf) { $navr = '410'; }
if ('/MOBILE.html' == $linkf) { $navr = '410'; }
if ('/FACEBOOK.htm' == $linkf) { $navr = '410'; }
if ('/FACEBOOK.HTM' == $linkf) { $navr = '410'; }






// 3.3 Filter 410 reguläre überholte Parameter URL für den Crowler gerecht entwerten.
if ('?'== substr($linkf, -1)) { $navr = '410'; }
if (strpos($linkf, '?') !== false) { $navr = '410'; }


// 3.4 Filter 410 reguläre überholte wildcards URL für den Crowler gerecht entwerten.
if (strpos($linkf, 'site') !== false) { $navr = '410'; }
if (strpos($linkf, 'contact') !== false) { $navr = '410'; }
if (strpos($linkf, 'clients') !== false) { $navr = '410'; }
if (strpos($linkf, 'home') !== false) { $navr = '410'; }
if (strpos($linkf, 'company') !== false) { $navr = '410'; }
if (strpos($linkf, 'seminars') !== false) { $navr = '410'; }
if (strpos($linkf, 'signal') !== false) { $navr = '410'; }
if (strpos($linkf, 'asset') !== false) { $navr = '410'; }
if (strpos($linkf, 'I.php') !== false) { $navr = '410'; }
if (strpos($linkf, 'preview') !== false) { $navr = '410'; }
if (strpos($linkf, '.jpg') !== false) { $navr = '410'; }
if (strpos($linkf, 'resources') !== false) { $navr = '410'; }
if (strpos($linkf, 'aktuelles') !== false) { $navr = '410'; }
if (strpos($linkf, '/m/') !== false) { $navr = '410'; }
if (strpos($linkf, 'guestbook') !== false) { $navr = '410'; }
if (strpos($linkf, '/Mullti/') !== false) { $navr = '410'; }
if (strpos($linkf, '/Mullti_dax') !== false) { $navr = '410'; }
if (strpos($linkf, '/Mullti_Dax') !== false) { $navr = '410'; }
if (strpos($linkf, '/search') !== false) { $navr = '410'; }
if (strpos($linkf, 'factsheet') !== false) { $navr = '410'; }
if (strpos($linkf, 'Filemanager') !== false) { $navr = '410'; }
if (strpos($linkf, '301') !== false) { $navr = '410'; }
if (strpos($linkf, 'boersen-wiki') !== false) { $navr = '410'; }



// 3.5 Filter 404. Url die ich noch nie hatte.
if ('/.well-known/assetlinks.json' == $linkf) { $navr = '404'; }
if ('/.well-known/apple-app-site-association' == $linkf) { $navr = '404'; }
if ('/apple-app-site-association' == $linkf) { $navr = '404'; }
if (strpos($linkf, 'well') !== false) { $navr = '404'; }
if (strpos($linkf, 'apple') !== false) { $navr = '404'; }


// hey was suchst du in diesem Verzeichnis Krümel Sucher ?
if ('/'== substr($linkf, -1)) { $navr = '404'; }


// Schau mal nach welches OS der Bot vorgibt zu sein.

function getBrowser()
{
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$bname = 'Unknown';
$platform = "";
$version= "";

//First get the platform?
if (preg_match('/linux/i', $u_agent)) {
$platform = 'linux';
}
elseif (preg_match('/macintosh|mac os x/i', $u_agent)) {
$platform = 'mac';
}
elseif (preg_match('/windows|win32/i', $u_agent)) {
$platform = 'windows';
}

// Next get the name of the useragent yes seperately and for good reason
if(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent))
{
$bname = 'Internet Explorer';
$ub = "MSIE";
}
elseif(preg_match('/Trident/i',$u_agent))
{ // this condition is for IE11
$bname = 'Internet Explorer';
$ub = "rv";
}
elseif(preg_match('/Firefox/i',$u_agent))
{
$bname = 'Mozilla Firefox';
$ub = "Firefox";
}
elseif(preg_match('/Chrome/i',$u_agent))
{
$bname = 'Google Chrome';
$ub = "Chrome";
}
elseif(preg_match('/Safari/i',$u_agent))
{
$bname = 'Apple Safari';
$ub = "Safari";
}
elseif(preg_match('/Opera/i',$u_agent))
{
$bname = 'Opera';
$ub = "Opera";
}
elseif(preg_match('/Netscape/i',$u_agent))
{
$bname = 'Netscape';
$ub = "Netscape";
}

// finally get the correct version number
// Added "|:"
$known = array('Version', $ub, 'other');
$pattern = '#(?<browser>' . join('|', $known) .
')[/|: ]+(?<version>[0-9.|a-zA-Z.]*)#';
if (!preg_match_all($pattern, $u_agent, $matches)) {
// we have no matching number just continue
}

// see how many we have
$i = count($matches['browser']);
if ($i != 1) {
//we will have two since we are not using 'other' argument yet
//see if version is before or after the name
if (strripos($u_agent,"Version") < strripos($u_agent,$ub)){
$version= $matches['version'][0];
}
else {
$version= $matches['version'][1];
}
}
else {
$version= $matches['version'][0];
}

// check if we have a number
if ($version==null || $version=="") {$version="?";}

return array(
'userAgent' => $u_agent,
'name' => $bname,
'version' => $version,
'platform' => $platform,
'pattern' => $pattern
);
}


// 5. Schau mal nach ob ich dich zuletzt schon gesperrt hatte.
$_url = "http://iqoption-spam.clan.rip/404/ip.txt";
$_current = implode('', file($_url));

// echo "<p>Last IP" . $_current . "</p>";
if ($_current == $_SERVER['REMOTE_ADDR']) { $navr = '418'; }

$_url = "https://www.autonomes-trading.de/404/ip.txt";
$_current = implode('', file($_url));

// echo "<p>Last IP" . $_current . "</p>";
if ($_current == $_SERVER['REMOTE_ADDR']) { $navr = '418'; }



// Gute Bots, welche sich auch nur als User getarnt haben, werden verschont und bekommen auch kein teatime. (die sind ja auch nicht gewerkschaftlich organisiert)
// geben wir Ihnen zuerst noch etwas Arbeit, damit die eventuell gesperrte IP genug Zeit hat sich freizuschreiben.

if ($navr == '418')
{


// whois.iana.org
// whois.ripe.net
// whois.arin.net
// whois.apnic.net
// whois.afrinic.net
// whois.lacnic.net
// whois.ncc.net

$IP = $_SERVER['REMOTE_ADDR'];

// ip by arin
// $IP = "66.249.93.47"; // google.com
// $IP = "157.55.39.12"; // microsoft.com
// $IP = "207.46.13.174"; // bing.com
// $IP = "204.236.235.245"; // amazon.com
// $IP = "67.195.37.0"; // yahoo-inc.com
// $IP = "100.43.90.0"; // yandex.net
// ip by ripe
// $IP = "61.135.249.200"; // Youdao Bot
// $IP = "180.76.15.1"; // Baidu Bot
// $IP = "46.51.197.88"; // Duckduck Bot
// $IP = "31.13.97.0";// Facebook Bot
// $IP = "220.181.125.0"; // Sogou Bot
// $IP = "169.45.2.160"; // Blekko Bot
// $IP = "217.117.147.192"; // ExaLead
// $IP = "217.75.103.128"; // Gigablast

/*
$whois_server = "whois.ripe.net";
if ($whois = fsockopen($whois_server, 43)) {
fwrite($whois, $IP."\r\n");
$result = "";
while (feof ($whois) === FALSE) {
$result .= fread($whois, 1024);
}
fclose($whois);
$show_result = ($show_result.'<pre>'.$result.'</pre>');
}
else {
$show_result = $show_result."Es ist ein Fehler aufgetreten: Verbindung zum Server konnte nicht aufgebaut werden!";
}
*/


$whois_server = "whois.arin.net";
if ($whois = fsockopen($whois_server, 43)) {
fwrite($whois, $IP."\r\n");
$result = "";
while (feof ($whois) === FALSE) {
$result .= fread($whois, 1024);
}
fclose($whois);
$show_result = ($show_result.'<pre>'.$result.'</pre>');
}
else {
$show_result = $show_result."Es ist ein Fehler aufgetreten: Verbindung zum Server konnte nicht aufgebaut werden!";
}


if (strpos($show_result, 'google.com') !== false) { $navr = '404'; }
if (strpos($show_result, 'microsoft.com') !== false) { $navr = '404'; }
if (strpos($show_result, 'bing.com') !== false) { $navr = '404'; }
if (strpos($show_result, 'amazon.com') !== false) { $navr = '404'; }
if (strpos($show_result, 'yahoo-inc.com') !== false) { $navr = '404'; }
if (strpos($show_result, 'yandex.') !== false) { $navr = '404'; }
if (strpos($show_result, 'qwant.com') !== false) { $navr = '404'; }


// 188.193.41.20 das ist meine, da ich mich gerne selbst sperren möchte
if ($IP == "188.193.41.20") { $navr = '404'; }

}







// Weiterleitungsziel. Wohin soll eine permanente Weiterleitung erfolgen?
if ($navr == '418')
{
// Vollsperrung über die .htacess
$_url = "https://www.autonomes-trading.de/htaccess_orginal.txt";
$_current_ht = file_get_contents($_url);

$dataFile = './.htaccess';
$line = "order allow,deny" . "\n" . "deny from " . $_SERVER['REMOTE_ADDR'] . "\n" . "Allow from All" . "\n" . $_current_ht;
$fileHandle = fopen($dataFile, 'w');
if (!fwrite($fileHandle, $line)) {
$error = 'Could not write to file, try again.';
}
fclose($fileHandle);

$dataFile = 'https://www.autonomes-trading.de/404/ip.txt';
$postingTime = date("F j, Y, g:i a");
$line = $_SERVER['REMOTE_ADDR'];

$fileHandle = fopen($dataFile, 'w');
if (!fwrite($fileHandle, $line)) {
$error = 'Could not write to file, try again.';
}
fclose($fileHandle);


$ua=getBrowser();
$dataFile = './404/404.txt';
$postingTime = date("F j, Y, g:i:s a");
$line = $postingTime . ',' . $_SERVER['REMOTE_ADDR'] . ',' . $_SERVER['HTTP_REFERER'] . ','. $linkf . ',' . substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) . ',' . $ua['name'] . ',' . $ua['version'] . ',' . $ua['platform'] . ',' . $current . ',' . $linkr . ',' . $_current . ',' . "\n" . $_SERVER['HTTP_USER_AGENT'] . "\n";
$fileHandle = fopen($dataFile, 'a');
if (!fwrite($fileHandle, $line)) {
$error = 'Could not write to file, try again.';
}
fclose($fileHandle);


header("HTTP/1.1 418 IM_A_TEAPOT");
header("Location:http://iqoption-spam.clan.rip/fehlermeldung.php");


}
else
{

// Entsperrung über die .htacess für den Fall ausversehen einen User erwischt zu haben. Da dieser langsam die Seiten aufruft, wird er wohl nicht in die Bot-Falle geraten.
$_url = "https://www.autonomes-trading.de/htaccess_orginal.txt";
$_current_ht = file_get_contents($_url);

$dataFile = './.htaccess';
$line = $_current_ht;
$fileHandle = fopen($dataFile, 'w');
if (!fwrite($fileHandle, $line)) {
$error = 'Could not write to file, try again.';
}
fclose($fileHandle);

$ua=getBrowser();
$dataFile = './404/404.txt';
$postingTime = date("F j, Y, g:i:s a");
$line = $postingTime . ',' . $_SERVER['REMOTE_ADDR'] . ',' . $_SERVER['HTTP_REFERER'] . ','. $linkf . ',' . substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) . ',' . $ua['name'] . ',' . $ua['version'] . ',' . $ua['platform'] . ',' . $current . ',' . $linkr . ',' . $_current . ',' . "\n" . $_SERVER['HTTP_USER_AGENT'] . "\n";
$fileHandle = fopen($dataFile, 'a');
if (!fwrite($fileHandle, $line)) {
$error = 'Could not write to file, try again.';
}
fclose($fileHandle);


if ($navr == "300")
{

header("HTTP/1.1 300 Multiple Choice");
echo file_get_contents("https://www.autonomes-trading.de/300.php?link=".$linkr);

}



if ($navr == "404")
{

header("HTTP/1.1 404 Not Found");
echo file_get_contents("https://www.autonomes-trading.de/404.php");


}

if ($navr == "410")
{

header("HTTP/1.1 410 Gone");
echo file_get_contents("https://www.autonomes-trading.de/410.php");


}



else
{



header("HTTP/1.1 301 Moved Permanently");
header("Location:https://www.autonomes-trading.de".$linkr);
}
}

// zur Sicherheit noch ein exit-Aufruf, falls Probleme aufgetreten sind
exit;
?>