title: How to grab referrer from a redirect using JavaScript?
body: <p>I know that I can find out the referrer using:</p>
  
  <pre><code>document.referrer;
  </code></pre>
  
  <p>However, I have a one page website, and a redirection set to send all other pages in that website to the home page. I would like to have a way of capturing the link that originated the redirection. In this case, document.referrer is always empty.</p>
  
  <p>So I guess, I need to know:</p>
  
  <ol>
  <li>How do I set a referrer parameter before the redirection?</li>
  <li>How do I capture that parameter with JavaScript in the home page?</li>
  </ol>