title: how to get referrer from a redirected url
body: <p>I have an url </p>
  
  <p><code>domain.com/a</code> </p>
  
  <p>which redirects to </p>
  
  <p><code>domain.com/controller/action/a</code> .</p>
  
  <p>How do I get the referrer (i.e domain.com/a) in my action for domain.com/controller/action/a ?</p>
  
  <p>One option was to add the referring domain as a parameter .</p>
  
  <p><code>domain.com/controller/action/a?referral=domain.com/a</code> .</p>
  
  <p>Is there a way to get the referrer without passing old referrer as a parameter. Like we would get from <code>**request.referrer**</code>. request.referrer doesn't seem to work with redirected urls.</p>
  
  <p>I am using Ruby on Rails for my development.</p>