META Tag Distribution

De vermelding van de metatag distribution heeft als doel de zoekmachines negatief te beïnvloeden bij inhoud die eigenlijk niet voor het grote publiek is bestemd.

Eigenlijk zou de betreffende pagina niet eens online beschikbaar moeten zijn!

  • Global - indicates that your webpage is intended for everyone;
  • Local - intended for local distribution of your document;
  • IU - Internal Use, not intended for public distribution.
<meta name="distribution" content="global" />
<meta name="distribution" content="local" />
<meta name="distribution" content="iu" />

Kohana Framework

De contante IN_PRODUCTION verteld ons of de website in een productie of in een test omgeving (localhost) draait :

define('IN_PRODUCTION', $_SERVER['SERVER_NAME'] != 'localhost' ? TRUE : FALSE);

Deze contante is in alle Smarty templates te gebruiken :

$this->template->set_global('IN_PRODUCTION', IN_PRODUCTION);

Met als resultaat in de Smarty view :

{if $IN_PRODUCTION}
    <meta name="distribution" content="global" />
{else}
    <meta name="distribution" content="iu" />
{/if}

Zend Framework
if (getenv('APPLICATION_ENV') == 'production') {
    $view->headMeta()->appendName('distribution', 'global');
} elseif (getenv('APPLICATION_ENV') == 'development') {
    $view->headMeta()->appendName('distribution', 'iu');
}