title: How do I add multiple urls to a wp_get_refererer?
body: <p>I have a cf7 form that is connected to multiple pages on the site. How do I allow these pages to have access to one thank you page? I tried this code below but it doesnt work.</p>
  <p>It doesnt work as in, only array[0] is getting redirected. Not the others.</p>
  <p>I am still a noob with PHP so do pardon the logic</p>
  <pre><code>add_action('template_redirect', function() {
      $theOrigins = array(
  'https://web1',
  'https://web2',
  'https://web3',
  'https://web4',
      
      );
      
      $ref = wp_get_referer();
  
  
      // ID of the thank you page
      if (!is_page(1234)) {
          return;
      }
  
      // coming from the form, so all is fine
      if (in_array($ref, $theOrigins)) {
          return;
      }
  
      // we are on thank you page
      // visitor is not coming from form
      // so redirect to home
      wp_redirect(get_home_url());
      exit;
  } );
  
  </code></pre>