]> git.openstreetmap.org Git - nominatim.git/blob - lib/init-website.php
Merge branch 'master' of http://github.com/twain47/Nominatim
[nominatim.git] / lib / init-website.php
1 <?php
2
3         require_once('init.php');
4
5         if (CONST_ClosedForIndexing && strpos(CONST_ClosedForIndexingExceptionIPs, ','.$_SERVER["REMOTE_ADDR"].',') === false)
6         {
7                 echo "Closed for re-indexing...";
8                 exit;
9         }
10
11         if (strpos(CONST_BlockedIPs, ','.$_SERVER["REMOTE_ADDR"].',') !== false)
12         {
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";
19                 exit;
20         }
21
22         header('Content-type: text/html; charset=utf-8');