S
S
Silentium20152015-10-20 19:58:45
PHP
Silentium2015, 2015-10-20 19:58:45

How to put meta name="robots" on technical domain address?

The site is available at the address of the technical domain http://43346.domain.ru. It is necessary to insert a meta tag on all its pages.
Or how can you display this label in the head script, for a specific address?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ostin, 2015-10-21
@Silentium2015

<?php
if ($_SERVER['SERVER_NAME'] === '43346.домен.ru') {
  echo '<meta name="robots">';
}

Just in case, check what is stored in this variable - the value may differ depending on the environment settings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question