-1

this work :

    <?php
  if ($_SERVER['REQUEST_URI'] !== '/fr/page1/'){
    echo '<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">';
  }
  ?>

(the meta tag not displayed on page 1)

but this not work :

    <?php
  if (($_SERVER['REQUEST_URI'] !== '/fr/page1/') || ($_SERVER['REQUEST_URI'] !== '/fr/page2')){
    echo '<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">';
  }
  ?>

the meta tag is displayed on both page :(

Thank you

Djo64
  • 11
  • 1
  • 3
  • What exactly do you want to happen when? (We need to know this in order to judge wether your OR logic is correct or not) – Chris S. Jan 12 '15 at 09:19

1 Answers1

1

|| – logical OR means if one of the expressions in some_expr1 || some_expr2 || some_expr3 is evaluated to TRUE then the whole expression is evaluated to TRUE. I guess you need to change it to logical AND&&.

potashin
  • 44,205
  • 11
  • 83
  • 107