Last active
December 18, 2015 03:58
-
-
Save ikr/5721701 to your computer and use it in GitHub Desktop.
Hide a xiag (dev) domain from Google
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$app->get('/robots.txt', function () { | |
return new Response( | |
( | |
(stripos($_SERVER['HTTP_HOST'], 'xiag') !== false) ? | |
"User-agent: *\nDisallow: /\n" : | |
"User-agent: *\n" | |
), | |
200, | |
['Content-Type' => 'text/plain'] | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment