javascript - document.referrer get blank -


i have set error pages in iis httpredirect.htm, trying convert http request https, when error 403.4 caught.

so if user types http url browser, triggers httpredirect.htm page , url, replace http https , redirect new url. want happen in javascript.

however, when use document.referrer in httpredirect.htm, found returns blank.

is there special consideration situation? can browser using error page carry information previous request?

you have @ location object. redirect on server-side.

scenarios:

  1. you go directly http://example.com/index.html, , httpredirect.htm rendered. since that´s first page visiting, referrer empty.
  2. you @ http://test.com/index.html , clicks on link http://example.com/index.html. seeing httpredirect.html, referrer page before, http://test.com/index.html.

since referrer depends on browser, can´t sure have in referrer object @ all, if "should" there. firewalls , anti-virus applications might disguise @ well.

if @ http://example.com/index.html , seeing httpredirect.htm, location.href still http://example.com/index.html though.

you can see example code using location here: http://kloudgate.wordpress.com/2013/05/30/how-to-redirect-http-to-https-using-iis7-0/


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -