# HTTP\_REFERER can't be obtained

**URL:** <https://www.ruby-forum.com/t/http-referer-cant-be-obtained/136464>\
**Category:** Rails\
**Created:** [May 2, 2008, 11:27am UTC](https://www.ruby-forum.com/t/http-referer-cant-be-obtained/136464 "2008-05-02T11:27:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![malioboro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eb8c5e/32.png) [@malioboro](https://www.ruby-forum.com/u/malioboro)\
**Post date:** [May 2, 2008, 11:27am UTC](https://www.ruby-forum.com/t/http-referer-cant-be-obtained/136464/1 "2008-05-02T11:27:08Z")

</div>

I run request.env in view and no HTTP\_REFERER there. How i can get  
HTTP\_REFERER ? I trace using “Live HTTP Header” in Firefox, the referer  
is obtained. I tested to IE, Mozzila, Opera, Gecko & Firefox, the  
result is the same. Referer is traced but http\_referer in rails still  
can’t be obtained.

I am using rails 2.0.2 & ruby 1.8.5, here the list of @request.env in my  
view :

* * *

SERVER\_NAME localhost

PATH\_INFO /editor

REMOTE\_HOST 127.0.0.1

HTTP\_ACCEPT\_ENCODING gzip,deflate

HTTP\_USER\_AGENT Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;  
rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.1;MEGAUPLOAD 1.0

SERVER\_PROTOCOL HTTP/1.1

HTTP\_ACCEPT\_LANGUAGE en-us,en;q=0.5

HTTP\_HOST localhost:3005

REMOTE\_ADDR 127.0.0.1

SERVER\_SOFTWARE WEBrick/1.3.1 (Ruby/1.8.5/2006-08-25)

HTTP\_KEEP\_ALIVE 300

HTTP\_COOKIE \_skate\_session\_id=ba502ec7409365e31a062be46bbed56d

HTTP\_ACCEPT\_CHARSET ISO-8859-1,utf-8;q=0.7,\*;q=0.7

REQUEST\_URI [http://localhost:3005/editor](http://localhost:3005/editor)

SERVER\_PORT 3005

GATEWAY\_INTERFACE CGI/1.1

QUERY\_STRING

REMOTE\_USER

HTTP\_ACCEPT  
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,_/_;q=0.5

REQUEST\_METHOD GET

HTTP\_CONNECTION keep-alive

* * *

any advice?

Reinhart  
[http://teapoci.blogspot.com](http://teapoci.blogspot.com)
