Skip to content

Instantly share code, notes, and snippets.

@ikr
Last active December 18, 2015 03:58
Show Gist options
  • Save ikr/5721701 to your computer and use it in GitHub Desktop.
Save ikr/5721701 to your computer and use it in GitHub Desktop.
Hide a xiag (dev) domain from Google
<?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