title: Deep linking an app in PHP is not working
body: <p>I have a webpage that needs to check to see if an app exists using a deep link, but it doesn't seem to work like it should. I have tried the following things.</p>
  
  <ol>
  <li>Using a redirect in PHP (Doesn't work)</li>
  </ol>
  
  <p><code>header('Location: exampleapp://param=test');</code></p>
  
  <ol start="2">
  <li><p>Using a redirect using JavaScript (Doesn't work)</p>
  
  <pre><code>var appurl = 'exampleapp://param=test';
  var appstore = 'https://itunes.apple.com/us/app/...';
  
  var timeout;
  function preventPopup() {
    clearTimeout(timeout);
    timeout = null;
    window.removeEventListener('pagehide', preventPopup);
  }
  function startApp() {
      window.location = appurl;
      timeout = setTimeout(function(){
      if(confirm('You do not seem to have the App installed, do you want to go download it now?')){
          document.location = appstore;
          }
      }, 100);
      window.addEventListener('pagehide', preventPopup);
  }
  
  // app start is then called in the onload
  </code></pre></li>
  <li><p>Same as above but replace the the line <code>window.location = appurl;</code> with <code>document.getElementById('deeplink').click();</code> and adding a link in the html's webpage. (Works) <code>&lt;a id="deeplink" href="exampleapp://param=test"&gt;Deep Link&lt;/a&gt;</code></p></li>
  </ol>
  
  <p>Is there a reason why you can't redirect using a header in PHP? </p>