title: Cakephp check if referer is from local url
body: <p>I'm struggeling a litte with my Cakephp 2.1 application.</p>
  
  <p>I want to render a different layout, if the referer is from an external url. Sadly this is not working :</p>
  
  <pre><code> if($this-&gt;referer(null, true))
       {
          $this-&gt;layout = 'lightview';
       }
       else 
       {
          $this-&gt;layout = 'default';
       }
  </code></pre>
  
  <p>Any ideas how I can fix this?</p>
  
  <p>Thanks in advance</p>