2 require_once('init.php');
4 header('Content-type: text/html; charset=utf-8');
6 // check blocks in place for external servers
7 if (strpos($_SERVER["REMOTE_ADDR"],'193.63.75.') !== 0 &&
8 strpos(CONST_WhitelistedIPs, ','.$_SERVER["REMOTE_ADDR"].',') === false)
11 if (strpos(CONST_BlockedIPs, ','.$_SERVER["REMOTE_ADDR"].',') !== false)
13 header('HTTP/1.0 403 Forbidden');
14 header('Content-type: text/html; charset=utf-8');
15 echo "<html><body><h1>Access blocked</h1>";
16 echo "Your IP has been blocked for overusing OpenStreetMap's volunteer-run servers.<br> \n";
17 echo 'Please consult the <a href="http://wiki.openstreetmap.org/wiki/Nominatim_usage_policy">Nominatim usage policy</a> for more information.';
18 echo "\n</body></html>\n";
22 $sTempBlockedIP = file_get_contents(CONST_IPBanFile);
23 if (preg_match('/\b'.$_SERVER["REMOTE_ADDR"].'\b/', $sTempBlockedIP))
25 header('HTTP/1.0 503 Service Temporarily Unavailable');
26 header('Content-type: text/html; charset=utf-8');
27 echo "<html><body><h1>Access blocked</h1>";
28 echo "Your IP has been blocked temporarily for overusing OpenStreetMap's volunteer-run servers. This ban will be lifted automatically in a while. To avoid further blocks, please read the<br> \n";
29 echo '<a href="http://wiki.openstreetmap.org/wiki/Nominatim_usage_policy">Nominatim usage policy</a> carefully before you continue to use this service.';
30 echo "\n</body></html>\n";