forked from laukstein/ajax-seo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrobots.txt
49 lines (32 loc) · 1.3 KB
/
robots.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
// --------------------------------------------------
// Web Robots
// https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt
// --------------------------------------------------
// Configuration
// --------------------------------------------------
include 'content/config.php';
header('Content-Type: text/plain');
// HTTP header caching
// --------------------------------------------------
function cache(&$file, $timestamp)
{
$gmtime = gmdate('D, d M Y H:i:s T', $timestamp);
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
if ($_SERVER['HTTP_IF_MODIFIED_SINCE'] == $gmtime || str_replace('"', '', stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])) == md5($timestamp . $file)) {
http_response_code(304);
exit;
}
}
header("Last-Modified: $gmtime");
}
cache($_SERVER['SCRIPT_FILENAME'], filemtime($_SERVER['SCRIPT_FILENAME']));
// Global rules
echo "User-agent: *\nDisallow:";
// Removing Documents From the Wayback Machine archive.org
echo "\n\nUser-agent: ia_archiver\nDisallow: /";
// Disable *.domaintools.com crawler
echo "\n\nUser-agent: SurveyBot\nDisallow: /";
// Be sure your sitemap.xml path is correct.
echo "\n\nSitemap: http://{$_SERVER['SERVER_NAME']}{$path}sitemap.xml";
?>